Try to fix the rest of the hyphen-minuses that should be dashes
This commit is contained in:
parent
eab0448455
commit
601d200c6b
1 changed files with 7 additions and 5 deletions
|
|
@ -149,7 +149,11 @@ function getBodyXml(chapter, contentEl) {
|
|||
// Fix use of ′ instead of closing single quote
|
||||
xml = xml.replace(/′/g, "’");
|
||||
|
||||
// Some fixes for dashes; not comprehensive
|
||||
// There are way too many nonbreaking spaces where they don't belong.
|
||||
// If they show up three in a row, then let them live. Otherwise, they die.
|
||||
xml = xml.replace(/([^\xA0])\xA0\xA0?([^\xA0])/g, "$1 $2");
|
||||
|
||||
// Fixes dashes
|
||||
xml = xml.replace(/ – /g, "—");
|
||||
xml = xml.replace(/“-/g, "“—");
|
||||
xml = xml.replace(/-”/g, "—”");
|
||||
|
|
@ -158,10 +162,8 @@ function getBodyXml(chapter, contentEl) {
|
|||
xml = xml.replace(/<p>-/g, "<p>—");
|
||||
xml = xml.replace(/-<\/p>/g, "—</p>");
|
||||
xml = xml.replace(/\s?\s?–\s?\s?/g, "—");
|
||||
|
||||
// There are way too many nonbreaking spaces where they don't belong.
|
||||
// If they show up three in a row, then let them live. Otherwise, they die.
|
||||
xml = xml.replace(/([^\xA0])\xA0\xA0?([^\xA0])/g, "$1 $2");
|
||||
xml = xml.replace(/-\s\s?/g, "—");
|
||||
xml = xml.replace(/\s?\s-/g, "—");
|
||||
|
||||
// Fix recurring broken-up <em>s
|
||||
xml = xml.replace(/<\/em>‘s/g, "’s</em>")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue