Jump to content

Wikipedia:AutoEd/links.js

From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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;
}