From a89414392ef6c6bc53a6b60b062c32092cd46cf7 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 26 Dec 2020 16:38:42 -0500 Subject: [PATCH] Fix some em dashes in Ward Last 20.e5 --- lib/convert-worker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/convert-worker.js b/lib/convert-worker.js index 5b9602d..5b1f4a0 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -383,11 +383,12 @@ function fixEmDashes(xml) { xml = xml.replace(/“((?:)?)-/g, "“$1—"); xml = xml.replace(/-[,.]?”/g, "—”"); xml = xml.replace(/-(!|\?)”/g, "—$1”"); - xml = xml.replace(/-[,.]?<\/em>”/g, "—”"); + xml = xml.replace(/-[,.]?<\/([a-z]+)>”/g, "—”"); xml = xml.replace(/-“/g, "—”"); xml = xml.replace(/

-/g, "

—"); xml = xml.replace(/-<\/p>/g, "—

"); - xml = xml.replace(/-<\/em><\/p>/g, "—

"); + xml = xml.replace(/-
/g, "—
"); + xml = xml.replace(/-<\/([a-z]+)><\/p>/g, "—

"); xml = xml.replace(/\s?\s?–\s?\s?/g, "—"); xml = xml.replace(/-\s\s?/g, "—"); xml = xml.replace(/\s?\s-/g, "—");