Content deleted Content added
Manishearth (talk | contribs) No edit summary |
Amorymeltzer (talk | contribs) m Remove legacy globals per phab:T72470 (via WP:JWB) |
||
Line 14:
par = getElementsByClassName(pre[i], "span", className);
for(j = 0; j < par.length; j++) {
par[j].innerHTML=par[j].innerHTML.replace(/\[\[([^\]\|]*)\]\]/g,"<a href='"+mw.config.get('wgServer')+mw.config.get('wgArticlePath')+"\'>$1</a>");
par[j].innerHTML=par[j].innerHTML.replace(/\[\[([^\]\|]*)[\|]?([^\]]*)\]\]/g,"<a href='"+mw.config.get('wgServer')+mw.config.get('wgArticlePath')+"'>$2</a>");
par[j].innerHTML=par[j].innerHTML.replace(/\[(http[s]?:[^\]\s]*)\]/g,"<a href=\'$1\'>$1</a>");
par[j].innerHTML=par[j].innerHTML.replace(/\[(http[s]?:[^\]\s]*)\s([^\]]*)\]/g,"<a href=\'$1\'>$2</a>");
Line 53:
quo='\"'
p = encodeURIComponent(h3.replace(q, "$1").replace(/[_\s]+/g, "_")).replace(/%2F/g, "/");
s.innerHTML = quo + '<a href=\"' + mw.config.get('wgArticlePath').replace("$1", p) + '\">' + h4.replace(q, "$1") + '</a>' + quo;
}else if(h2.match(/'([^'\"]+)\'/)) {
q = /'([^'\"]*)'/g;
quo="\'"
p = encodeURIComponent(h3.replace(q, "$1").replace(/[_\s]+/g, "_")).replace(/%2F/g, "/");
s.innerHTML = quo + '<a href=\"' + mw.config.get('wgArticlePath').replace("$1", p) + '\">' + h4.replace(q, "$1") + '</a>' + quo;
}else{ continue;}
|