User:Manishearth/scriptlinks.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 42:
var h= s.innerHTML + "";
var h2=h+"";
var h3=h2+""
var q;
var quo;
Line 48 ⟶ 49:
q = /"([^"]+)"/g;
quo='"'
}else if(hh2.match(/'([^']+)'/)) {
q = /'([^']+)'/g;
quo="'"
}else continue;
var h3h4=h2h3+"";
p = encodeURIComponent(h3.replace(q, "$1").replace(/[_\s]+/g, "_")).replace(/%2F/g, "/");
s.innerHTML = quo + '<a href="' + wgArticlePath.replace("$1", p) + '">' + h2hh.replace(q, "$1") + '</a>' + quo;
}
}