diff --git a/lib/convert-worker.js b/lib/convert-worker.js index c29163c..a01a2a1 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -119,9 +119,6 @@ function getBodyXML(chapter, book, contentEl) { h1El.textContent = chapter.title; bodyEl.appendChild(h1El); - const comment = contentEl.ownerDocument.createComment(chapter.url); - bodyEl.appendChild(comment); - while (contentEl.firstChild) { bodyEl.appendChild(contentEl.firstChild); } @@ -458,8 +455,11 @@ function getBodyXML(chapter, book, contentEl) { } }); - // Serializer inserts extra xmlns for us since it doesn't know we're going to put this into a - xml = xml.replace(//, ""); + // Serializer inserts extra xmlns for us since it doesn't know we're going to put this into a . + // Use this opportunity to insert a comment pointing to the original URL, for reference. + xml = xml.replace( + //, + `\n\n`); return xml; }