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:
parent
e13ca0de74
commit
51520c11be
1 changed files with 5 additions and 1 deletions
|
|
@ -130,10 +130,14 @@ function getBodyXML(chapter, contentEl) {
|
||||||
|
|
||||||
// Synthesize a <body> tag to serialize
|
// Synthesize a <body> tag to serialize
|
||||||
const bodyEl = contentEl.ownerDocument.createElement("body");
|
const bodyEl = contentEl.ownerDocument.createElement("body");
|
||||||
|
|
||||||
const h1El = contentEl.ownerDocument.createElement("h1");
|
const h1El = contentEl.ownerDocument.createElement("h1");
|
||||||
h1El.textContent = chapter.title;
|
h1El.textContent = chapter.title;
|
||||||
|
|
||||||
bodyEl.appendChild(h1El);
|
bodyEl.appendChild(h1El);
|
||||||
|
|
||||||
|
const comment = contentEl.ownerDocument.createComment(chapter.url);
|
||||||
|
bodyEl.appendChild(comment);
|
||||||
|
|
||||||
while (contentEl.firstChild) {
|
while (contentEl.firstChild) {
|
||||||
bodyEl.appendChild(contentEl.firstChild);
|
bodyEl.appendChild(contentEl.firstChild);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue