From 3e2bc4a4479c15a67adbca2bf0af6ea3e266ee0e Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 22 Oct 2020 22:27:02 -0400 Subject: [PATCH] Fix train station capitalization --- lib/convert-worker.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/convert-worker.js b/lib/convert-worker.js index f3511f6..db0d832 100644 --- a/lib/convert-worker.js +++ b/lib/convert-worker.js @@ -377,12 +377,10 @@ function getBodyXML(chapter, contentEl) { // Place names need to always be capitalized xml = xml.replace(/North end/g, "North End"); - xml = xml.replace(/Stonemast avenue/g, "Stonemast Avenue"); - xml = xml.replace(/Shale avenue/g, "Shale Avenue"); - xml = xml.replace(/Lord street/g, "Lord Street"); - xml = xml.replace(/Slater street/g, "Slater Street"); - xml = xml.replace(/Hollow point/g, "Hollow Point"); - xml = xml.replace(/Cedar point/g, "Cedar Point"); + xml = xml.replace(/(Stonemast|Shale) avenue/g, "$1 Avenue"); + xml = xml.replace(/(Lord|Slater) street/g, "$1 Street"); + xml = xml.replace(/(Hollow|Cedar) point/g, "$1 Point"); + xml = xml.replace(/(Norwalk|Fenway|Stratford) station/g, "$1 Station"); // These are usually not italicized, but sometimes are. Other foreign-language names (like Yàngbǎn) are not // italicized, so we go in the direction of removing the italics.