From 547b7e95180dc576f9b1235dc4fcdd5736f0cbdb Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 7 Nov 2020 16:12:41 -0500 Subject: [PATCH] Restore original scene breaks, instead of using
--- lib/convert-worker.js | 22 +++++++++++++--------- lib/substitutions.json | 6 +++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/convert-worker.js b/lib/convert-worker.js index c0305d5..d0fc0c9 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -288,15 +288,19 @@ function getBodyXML(chapter, book, contentEl) { xml = xml.replace(/Simurgh-Myrddin-plant/g, "Simurgh–Myrddin–plant"); xml = xml.replace(/Armsmaster-Defiant/g, "Armsmaster–Defiant"); - // Use
for separators - // https://www.parahumans.net/2019/12/21/interlude-18-z-radiation/ has "super-separators" ("⊙ ⊙ ⊙ ⊙ ⊙") which we - // leave untouched for now. - xml = xml.replace(/

■<\/p>/g, "


"); - xml = xml.replace(/

■<\/p>/g, "


"); - xml = xml.replace(/

⊙<\/p>/g, "


"); - xml = xml.replace(/

⊙<\/strong><\/p>/g, "


"); - xml = xml.replace(/

⊙<\/strong><\/em><\/p>/g, "


"); - xml = xml.replace(/

⊙⊙<\/strong><\/p>/g, "


"); + // Normalize scene breaks.
would be more semantically appropriate, but loses the author's intent. This is + // especially the case in Ward, which uses a variety of different scene breaks. + xml = xml.replace(/]*)>■<\/p>/g, `

`); + + xml = xml.replace(/

⊙<\/p>/g, `

`); + xml = xml.replace(/

⊙<\/strong><\/p>/g, `

`); + xml = xml.replace(/

⊙<\/strong><\/em><\/p>/g, + `

`); + xml = xml.replace(/

⊙⊙<\/strong><\/p>/g, + `

`); + + xml = xml.replace(/

⊙ *⊙ *⊙ *⊙ *⊙<\/strong><\/p>/g, + `

⊙ ⊙ ⊙ ⊙ ⊙

`); // Fix recurring miscapitalization with questions xml = xml.replace(/\?”\s\s?She asked/g, "?” she asked"); diff --git a/lib/substitutions.json b/lib/substitutions.json index 04dd1b7..e0f82cd 100644 --- a/lib/substitutions.json +++ b/lib/substitutions.json @@ -5,7 +5,7 @@ "after": "bugs: flies, ants" }, { - "before": "

Brief note from the author: This story isn’t intended for young or sensitive readers. Readers who are on the lookout for trigger warnings are advised to give Worm a pass.

\n
\n", + "before": "

Brief note from the author: This story isn’t intended for young or sensitive readers. Readers who are on the lookout for trigger warnings are advised to give Worm a pass.

\n

\n", "after": "", "_comment": "The pseudo-trigger warning is out of place in an eBook." } @@ -4334,7 +4334,7 @@ ], "https://www.parahumans.net/2017/09/11/daybreak-1-1/": [ { - "before": "

Ward is the second work in the Parahumans series, and reading Worm first is strongly recommended. A lot of this won’t make sense otherwise and if you do find yourself a fan of the universe, the spoilers in Ward will affect the reading of the other work.

\n

Ward is not recommended for young or sensitive readers.

\n
", + "before": "

Ward is the second work in the Parahumans series, and reading Worm first is strongly recommended. A lot of this won’t make sense otherwise and if you do find yourself a fan of the universe, the spoilers in Ward will affect the reading of the other work.

\n

Ward is not recommended for young or sensitive readers.

\n

\n", "after": "", "_comment": "This is out of place in an eBook." } @@ -5013,7 +5013,7 @@ ], "https://www.parahumans.net/2018/06/05/torch-7-5/": [ { - "before": "
\n

I don’t", + "before": "

\n

I don’t", "after": "

I don’t" }, {