Spot fixes for Arc 9, Sentinel; additional general fixes

The additional general fixes include:

* Fix "tv" and "T.V." to become "TV" like most other uses in the book
* Fix "I-I" to "I—I" and "I-uh" to "I—uh" conversions which weren't working properly.
* Add periods to the end of some paragraphs that were missing them.
* More of the never-ending italics and spacing work.
This commit is contained in:
Domenic Denicola 2017-12-22 13:39:44 -05:00
commit b9f79429b1
2 changed files with 351 additions and 22 deletions

View file

@ -157,6 +157,11 @@ function getBodyXML(chapter, contentEl) {
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>");
xml = xml.replace(/([^\n>])<em> ?/g, "$1 <em>");
xml = xml.replace(/ ?<\/em>/g, "</em> ");
xml = xml.replace(/<p([^>]+)> <em>/g, "<p$1><em>");
xml = xml.replace(/<\/em> <\/p>/g, "</em></p>");
xml = xml.replace(/<em>([a-z]+),<\/em>/g, "<em>$1</em>,");
// Fix recurring poor quotes and apostrophes
xml = xml.replace(/<p>”/g, "<p>“");
@ -192,8 +197,8 @@ function getBodyXML(chapter, contentEl) {
xml = xml.replace(/-\s\s?/g, "—");
xml = xml.replace(/\s?\s-/g, "—");
xml = xml.replace(/\s+—”/g, "—”");
xml = xml.replace(/I-I/g, "I—I");
xml = xml.replace(/I-uh/g, "I—uh");
xml = xml.replace(/I-I/g, "I—I");
xml = xml.replace(/I-uh/g, "I—uh");
// Use <hr> for separators
xml = xml.replace(/<p>■<\/p>/g, "<hr/>");
@ -210,6 +215,10 @@ function getBodyXML(chapter, contentEl) {
xml = xml.replace(/ \.<\/p>/g, ".</p>");
xml = xml.replace(/\.<em>\.\./g, "<em>…");
// Fix extra spaces
xml = xml.replace(/ ? <\/p>/g, "</p>");
xml = xml.replace(/([a-z]) ,/g, "$1,");
// The author often fails to terminate a sentence, instead using a comma after a dialogue tag. For example,
// > “I didnt get much done,” Greg said, “I got distracted by...
// This should instead be
@ -233,9 +242,13 @@ function getBodyXML(chapter, contentEl) {
// it's incorrect to capitalize in the one-off fixes.
xml = xml.replace(/the clairvoyant/g, "the Clairvoyant");
// This is sometimes missing its capitalization
// This is sometimes missing its capitalization.
xml = xml.replace(/the birdcage/g, "the Birdcage");
// This is usually spelled "TV" but sometimes the other ways. Normalize.
xml = xml.replace(/tv/g, "TV");
xml = xml.replace(/T\.V\./g, "TV");
// There's no reason why these should be capitalized. (Note that they never appear at the beginning of any sentences.)
xml = xml.replace(/Halberd/g, "halberd");
xml = xml.replace(/Loft/g, "loft");