diff --git a/lib/convert.js b/lib/convert.js index 8050d27..7c5e08f 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -154,12 +154,13 @@ function getBodyXml(chapter, contentEl) { xml = xml.replace(/“([^>]+)<\/em>(!|\?|\.)”/g, "“$1$2<\/em>”"); xml = xml.replace(/

([^>]+)<\/em>(!|\?|\.)<\/p>/g, "

$1$2<\/em>

"); - // Fix recurring poor closing quotes + // Fix recurring poor quotes and apostrophes xml = xml.replace(/“<\/p>/g, "”

"); xml = xml.replace(/‘<\/p>/g, "’

"); - - // Fix use of ′ instead of closing single quote xml = xml.replace(/′/g, "’"); + xml = xml.replace(/′/g, "’"); + xml = xml.replace(/([A-Za-z])‘s(\s?)/g, "$1’s$2"); + xml = xml.replace(/I‘m/g, "I’m"); // Fixes dashes xml = xml.replace(/ – /g, "—");