From 2a0919547122dbd9de92c2c457189fab01b32b61 Mon Sep 17 00:00:00 2001
From: Domenic Denicola
Date: Sun, 29 Nov 2020 15:34:23 -0500
Subject: [PATCH] Italicize question marks in single-question-word sentences
---
lib/convert-worker.js | 3 ++-
lib/substitutions.json | 12 ------------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/lib/convert-worker.js b/lib/convert-worker.js
index c4747bc..ec9ed38 100644
--- a/lib/convert-worker.js
+++ b/lib/convert-worker.js
@@ -198,9 +198,10 @@ function getBodyXML(chapter, book, contentEl) {
xml = xml.replace(/([\w ’]+[!.?])”<\/em>/g, "$1”");
xml = xml.replace(/I”(m|ll)/g, "I’$1");
xml = xml.replace(/””<\/p>/g, "”
");
- xml = xml.replace(/^([^“]+? ?)”(?![ —<])/gm, "$1 “");
+ xml = xml.replace(/^([^“]+?) ?”(?![ —<])/gm, "$1 “");
xml = xml.replace(/(?([A-Za-z]+),<\/em>(?!”| +[A-Za-z]+ thought)/, "$1,");
xml = xml.replace(/‘([Kk])ay(?!’)/g, "’$1ay");
+ xml = xml.replace(/(Why|What|Who|How|Where|When)<\/em>\?/g, "$1?");
// Similar problems occur in Ward with and as do in Worm with s
xml = xml.replace(//g, "");
diff --git a/lib/substitutions.json b/lib/substitutions.json
index d9aed16..0f603b3 100644
--- a/lib/substitutions.json
+++ b/lib/substitutions.json
@@ -1539,10 +1539,6 @@
"before": "Brian, “You’re",
"after": "Brian. “You’re"
},
- {
- "before": "Why? Why come",
- "after": "Why? Why come"
- },
{
"before": "‘Sides",
"after": "’Sides"
@@ -7166,10 +7162,6 @@
"before": "I got a glimpse. it’s fucking with me",
"after": "I got a glimpse. It’s fucking with me"
},
- {
- "before": "What? But Cassie.",
- "after": "What? But Cassie."
- },
{
"before": "‘aunt Rachel‘s’",
"after": "‘Aunt Rachel’s’"
@@ -7200,10 +7192,6 @@
"before": "got the Thrall Commander, right",
"after": "got the thrall commander, right"
},
- {
- "before": "I could ask these questions. Why?",
- "after": "I could ask these questions. Why?"
- },
{
"before": "the Yàngbǎn supported squad",
"after": "the Yàngbǎn-supported squad"