Fix messed up chapters with text conversations

aea63ba055 introduced a bug where these chapters would contain ill-formed XML, and so at least some eBook readers would refuse to display them.
This commit is contained in:
Domenic Denicola 2020-11-17 10:39:03 -05:00
commit d69484af8e

View file

@ -207,7 +207,7 @@ function getBodyXML(chapter, book, contentEl) {
xml = xml.replace(/<strong>@<\/strong>/g, "@");
xml = xml.replace(/<br \/>(\s*)<\/strong>/g, "</strong><br />$1");
xml = xml.replace(/(\s*)<\/strong>/g, "</strong>$1");
xml = xml.replace(/><strong>(.*)<\/strong>:</g, "><strong>$1:</strong></");
xml = xml.replace(/><strong>(.*)<\/strong>:</g, "><strong>$1:</strong><");
// No need for line breaks before paragraph ends
// These often occur with the <br>s inside <b>/<strong>/<em>/<i> fixed above.