Jump to content

Wikipedia:AutoEd/links.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Pppery (talk | contribs) at 20:32, 25 January 2024 (Pppery changed the content model of the page Wikipedia:AutoEd/links.js from "wikitext" to "JavaScript"). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
function autoEdLinks(str) { //MAIN FUNCTION describes list of fixes

    str = str.replace(/\]\[/g, "] [");

    //repair bad external links
    str = str.replace(/\[?\[http:\/\/([^\]\n]*?)\]\]?/gi, "[http://$1]");
    //str = str.replace(/\[http:\/\/([^\]]*?)\|([^\]]*?)\]/gi, "[http://$1 $2]");

    return str;
}