Normalize Ward chapter titles

This commit is contained in:
Domenic Denicola 2020-07-01 16:04:37 -04:00
commit 559681e4ec

View file

@ -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) {