User:Quarl/___location canonicalize.js: Difference between revisions

Content deleted Content added
〈"location_canonicalize_wikilink((wlink||wtext)" → "location_canonicalize wikilink((wlink||wtext)"〉
〈"*(" → "(", "+state+ " → "\\[\\[ +state+ \\]\\]"〉
Line 71:
 
this.regexp_USsubstate = (
new RegExp('^([^,]+), *(' + this.USstates.join('|') + ')$'));
this.USstates.join('|') +
')$'));
this.regexp_USstate = (
new RegExp('^(?:' + this.USstates.join('|') + ')$'));
')$'));
}
 
Line 90 ⟶ 87:
var wfull = '[[' + wtext + '|' + city + ']]';
// only add link to state and country if we haven't yet mentioned them.
if (!left.match('\\[\\['+state+'\\]\\]')) {
wfull += ', [['+state+']]';