Content deleted Content added
moveRefsOutsideOfItalics() (publish.php) |
swapRefCommaWithCommaRef() (publish.php) |
||
Line 228:
wikicode = this.deleteNewLinesBetweenRefs(wikicode);
wikicode = this.swapRefPeriodWithPeriodRef(wikicode);
wikicode = this.swapRefCommaWithCommaRef(wikicode);
// stuff we want to run at the end
wikicode = this.fixDoublePeriod(wikicode); // need test cases. I've seen this one not work.
Line 372 ⟶ 373:
}
// TOOL
swapRefPeriodWithPeriodRef(wikicode) {
wikicode = wikicode.replace(/((?:<ref[^>]*?>[^>]*?<\/ref>){1,})\. /gm, '.$1 ');
wikicode = wikicode.replace(/((?:<ref[^>]*?>[^>]*?<\/ref>){1,})\.\n/gm, ".$1\n");
return wikicode;
}
swapRefCommaWithCommaRef(wikicode) {
wikicode = wikicode.replace(/((?:<ref[^>]*?>[^>]*?<\/ref>){1,})\, /gm, ',$1 ');
wikicode = wikicode.replace(/((?:<ref[^>]*?>[^>]*?<\/ref>){1,})\,\n/gm, ",$1\n");
return wikicode;
}
|