Content deleted Content added
regexp bf |
prune null changes |
||
Line 121:
var c = this.countries[i];
var changes = 0;
var wfull;
if (wtext.match(c.regexp_substate)) {
var city = RegExp.$1, state = RegExp.$2;
++changes;
wfull = '[[' + wtext + '|' + city + ']]';
// only add link to state and country if we haven't yet mentioned them.
Line 139 ⟶ 141:
if (left.match(c.regexp_country)) {
++changes;
// Already mentioned country. Delete redundant subsequent
// country links
Line 147 ⟶ 150:
// it's there already; good.
} else {
++changes;
// not there; add it.
wfull += ', ' + c.link_country;
Line 152 ⟶ 156:
}
if (changes) {
return { wfull: wfull, left: left, right: right}; } else {
return null;
}
}
|