Fix extra non-breaking spaces after periods

This commit is contained in:
Domenic Denicola 2020-10-17 20:15:29 -04:00
commit cac9a924dc

View file

@ -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 <em>s