From f932be159c1fdc740ebdaff563cedcba54ca86e9 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
Date: Sat, 9 May 2015 00:21:05 +0200
Subject: [PATCH] More clean-ups; do these at a textual level.
---
lib/convert.js | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/lib/convert.js b/lib/convert.js
index a92ec3e..3d8cee4 100644
--- a/lib/convert.js
+++ b/lib/convert.js
@@ -50,7 +50,7 @@ function convertChapter(filePath, contentPath) {
function getChapterString(rawChapterDoc) {
const title = rawChapterDoc.querySelector("h1.entry-title").textContent;
- const body = cleanContentEl(rawChapterDoc.querySelector(".entry-content")).innerHTML;
+ const body = cleanContentEl(rawChapterDoc.querySelector(".entry-content"));
return `
@@ -103,7 +103,16 @@ function cleanContentEl(el) {
}
});
- return el;
+ let html = el.innerHTML;
+
+ // Fix recurring strange pattern of extra
in ......
\n
+ html = html.replace(/
\s*<\/em><\/p>/g, '
');
+
+
+ // One-off fixes
+ html = html.replace(/truck reached
\nthe other Nine/, 'truck reached the other Nine');
+
+ return html;
}
function isEmptyOrGarbage(el) {