Content deleted Content added
add fixHeadingsInAllCaps() (publish.php) |
fix bug involving extra spaces in heading (publish.php) |
||
Line 553:
fixHeadingsInAllCaps(wikicode) {
// create a concatenated string with the text from every heading
let matches = wikicode.matchAll(/==
let headingString = '';
for ( let match of matches ) {
Line 562:
if ( this._isUpperCase(headingString) ) {
// convert all headings to sentence case
let matches = wikicode.matchAll(/==
for ( let match of matches ) {
let matchRegex = this._escapeRegEx(match[1].trim());
matchRegex = new RegExp('==
let sentenceCase = this._toSentenceCase(match[1].trim());
wikicode = wikicode.replace(matchRegex, '== ' + sentenceCase + ' ==');
|