Normalize italics and single quotes together

This commit is contained in:
Domenic Denicola 2017-11-04 16:23:53 -07:00
commit 520962e633

View file

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