Jump to content

User:Portuguese Man o' War/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Portuguese Man o' War (talk | contribs) at 20:32, 23 September 2011 (Wikipedia:AutoEd/whitespace.js override). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('Wikipedia:AutoEd/complete.js');
function autoEdWhitespace(str) { //MAIN FUNCTION describes list of fixes

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

    str = str.replace(/^ ? ? \n/gm, "\n");
    str = str.replace(/(\n\n)\n+/g, "$1");
    str = str.replace(/== ? ?\n\n==/g, "==\n==");
    str = str.replace(/\n\n(\* ?\[?http)/g, "\n$1");

    str = str.replace(/^ ? ? \n/gm, "\n");
    str = str.replace(/\n\n\*/g, "\n*");
    str = str.replace(/[ \t][ \t]+/g, " ");
    //str = str.replace(/([=\n]\n)\n+/g, "$1");
    str = str.replace(/ \n/g, "\n");

    //* bullet points
    str = str.replace(/^([\*#]+:*) /gm, "$1");
    str = str.replace(/^([\*#]+:*)/gm, "$1 ");

    //==Headings==
    //str = str.replace(/^(={1,4}) ?(.*?) ?(={1,4})$/gm, "$1$2$3");
    return str;
}

importScript('User:Dr pda/prosesize.js');
//importScript("User:GregU/dashes.js");
importScript('User:Cameltrader/Advisor.js');
importScript('User:Snottywong/diffconverter.js');
importScript('user:js/urldecoder.js')
var urlDecoderIntLinks = true; //also try to simplify existing [[internal links]] in selected text
importScript('User:Ohconfucius/script/EngvarB.js');
importScript('User:Ohconfucius/script/MOSNUM dates.js');
importScript("User:PleaseStand/segregate-refs.js");
var SegregateRefsJsAllowConversion = true;
importScript('MediaWiki:Gadget-HotCat.js');
importScript('User:Ucucha/HarvErrors.js');