From bcca56866c354d7ae01ac1010c40d42f3ce64842 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 26 Oct 2020 21:29:21 -0400 Subject: [PATCH] Revise the chapter URL comments --- lib/convert-worker.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; }