Add an original-URL HTML comment to each chapter

This makes it easier for me to figure out how to update substitutions.json.
This commit is contained in:
Domenic Denicola 2020-10-22 19:20:29 -04:00
commit 51520c11be

View file

@ -130,10 +130,14 @@ function getBodyXML(chapter, contentEl) {
// Synthesize a <body> tag to serialize
const bodyEl = contentEl.ownerDocument.createElement("body");
const h1El = contentEl.ownerDocument.createElement("h1");
h1El.textContent = chapter.title;
bodyEl.appendChild(h1El);
const comment = contentEl.ownerDocument.createComment(chapter.url);
bodyEl.appendChild(comment);
while (contentEl.firstChild) {
bodyEl.appendChild(contentEl.firstChild);
}