From 559681e4ece0cc5eb76a6b6af8c4fb0cf83a97ff Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 1 Jul 2020 16:04:37 -0400 Subject: [PATCH] Normalize Ward chapter titles --- lib/download.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/download.js b/lib/download.js index 0e5b40e..b7541ab 100644 --- a/lib/download.js +++ b/lib/download.js @@ -89,7 +89,11 @@ function getNextChapterURL(rawChapterDoc) { } function getChapterTitle(rawChapterDoc) { - return rawChapterDoc.querySelector("h1.entry-title").textContent; + // Remove " – " because it's present in Ward but not in Worm, which is inconsistent. (And leaving it in causes slight + // issues down the line where we remove spaces around em dashes during conversion.) In the future it might be nice to + // have proper chapter titles, e.g. sections per arc with title pages and then just "1" or similar for the chapter. + // Until then this is reasonable and uniform. + return rawChapterDoc.querySelector("h1.entry-title").textContent.replace(/ – /, " "); } function retry(times, fn) {