Always capitalize "Nazi"

Also fix hyphenation and capitalization around "neo-Nazi".
This commit is contained in:
Domenic Denicola 2020-11-23 16:32:08 -05:00
commit 60709f54c2

View file

@ -505,6 +505,12 @@ function fixCapitalization(xml, book) {
// place name. So we remove the capitalization in the few places where it does appear.
xml = xml.replace(/Wardens’ Headquarters/g, "Wardens’ headquarters");
// Some style guides try to reserve capitalized "Nazi" for historical discussions of members of the Nazi party. This
// seems fuzzy when it comes to phrases like "neo-Nazi", and doesn't seem to be what the author is doing; the books
// are just plain inconsistent. So, let's standardize on always uppercasing.
xml = xml.replace(/(?<![a-z])nazi/g, "Nazi");
xml = xml.replace(/ Neo-/g, " neo-");
return xml;
}
@ -534,6 +540,9 @@ function fixHyphens(xml) {
xml = xml.replace(/well armed/g, "well-armed");
xml = xml.replace(/able bodied/g, "able-bodied");
// This is usually correct but sometimes wrong.
xml = xml.replace(/neo /g, "neo-");
return xml;
}