diff --git a/lib/convert.js b/lib/convert.js index 81277ed..2160a1f 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -146,7 +146,9 @@ function getBodyXML(chapter, contentEl) { // There are way too many nonbreaking spaces where they don't belong. // If they show up three in a row, then let them live. Otherwise, they die. + // Also remove any run of them after a period. xml = xml.replace(/([^\xA0])\xA0\xA0?([^\xA0])/g, "$1 $2"); + xml = xml.replace(/\.\xA0+\s*/, ". "); function fixEms() { // Fix recurring broken-up or erroneous s