User:Ohconfucius/test/Sources subscript1.js: Difference between revisions

Content deleted Content added
false negative at source names to italicised 'wikiname'
+newWord3
Line 376:
newWord = '$1' + table[ word ] + '$2';
newWord2 = '$1\'\'' + table[ word ] + '\'\'$2';
newWord3 = '$1\'\'\\[\\[' + table[ word ] + '\\]\\]\'\'$2';
var txt="";
try {
Line 390 ⟶ 391:
 
// source names to italicised 'wikiname' - unlinked; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?[\\]\\.,;]\\s)' + word + '(?: online|)([^\]<]*?<\\/ref>)', 'gi')
regex(re, newWord2) //NOTE: adaptation to italicise is built into 'newWord2'
// source names to italicised 'wikiname' - linked; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?[\\]\\.,;]\\s\\[\\[(?:[^\\|\\]]*\\||))' + word + '(?: online|)(\\]\\][^<]*?<\\/ref>)', 'gi')
regex(re, newWord2) //NOTE: adaptation to italicise is built into 'newWord2'
// source names to italicised 'wikiname' - linked, unpiped; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?[\\]\\.,;]\\s)\\[\\[(?:[^\\|\\]]*\\||))' + word + '(?: online|)(\\]\\]([^<]*?<\\/ref>)', 'gi')
regex(re, newWord2newWord3) //NOTE: adaptation to italicise linked is built into 'newWord2newWord3'
}
catch(err) {