diff --git a/lib/convert.js b/lib/convert.js index 457e081..a4251be 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -130,10 +130,14 @@ function getBodyXML(chapter, contentEl) { // Synthesize a 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); }