Fix trailing spaces before </em>

Closes #2.
This commit is contained in:
Domenic Denicola 2017-08-13 16:07:26 -04:00
commit a27b8a6e2f
2 changed files with 6 additions and 5 deletions

View file

@ -151,6 +151,7 @@ function getBodyXML(chapter, contentEl) {
xml = xml.replace(/<p><em>([^>]+)<\/em>(!|\?|\.)<\/p>/g, "<p><em>$1$2</em></p>");
xml = xml.replace(/(!|\?|\.)\s{2}<\/em><\/p>/g, "$1</em></p>");
xml = xml.replace(/<em>([a-z]+)\?<\/em>/g, "<em>$1</em>?");
xml = xml.replace(/<em>([^>]+?)( +)<\/em>/g, "<em>$1</em>$2");
// Fix recurring poor quotes and apostrophes
xml = xml.replace(/<p>”/g, "<p>“");