diff --git a/lib/convert.js b/lib/convert.js index 8685c10..9b39cfd 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -147,13 +147,13 @@ function getBodyXml(chapter, contentEl) { xml = xml.replace(/([^\xA0])\xA0\xA0?([^\xA0])/g, "$1 $2"); // Fix recurring broken-up or erroneous s - xml = xml.replace(/<\/em>‘s/g, "’s") + xml = xml.replace(/<\/em>‘s/g, "’s"); xml = xml.replace(/<\/em>/g, ""); xml = xml.replace(/(\s?\s?[^A-Za-z]\s?\s?)<\/em>/g, "$1"); xml = xml.replace(/<\/em>(\s?\s?[^A-Za-z]\s?\s?)/g, "$1"); xml = xml.replace(/“([^>]+)<\/em>(!|\?|\.)”/g, "“$1$2<\/em>”"); xml = xml.replace(/

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

$1$2<\/em>

"); - xml = xml.replace(/(!|\?|\.) <\/em><\/p>/g, "$1

"); + xml = xml.replace(/(!|\?|\.)\s{2}<\/em><\/p>/g, "$1

"); // Fix recurring poor quotes and apostrophes xml = xml.replace(/

”/g, "

“");