Jump to content

User:Maathavan/AutoEd/templates.js

From Wikipedia, the free encyclopedia
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.
//<source lang=javascript>

function autoEdTemplates(str) { //MAIN FUNCTION describes list of fixes

 //Remove unneeded Template: text from transclusions
 str = str.replace(/{{[_ ]*Template:[_ ]*/gi, '{{');
 
 //Remove unneeded வார்ப்புரு: text from transclusions
 str = str.replace(/{{[_ ]*வார்ப்புரு:[_ ]*/gi, '{{');
 
 // Translate "unreferenced" in Tamil as "சான்றில்லை"
 str = str.replace(/({{[\t ]*)unreferenced([\t ]*}})/gi, "$1சான்றில்லை$2");
 
  // Translate "unreferenced" in Tamil as "சான்றில்லை"
  str = str.replace(/([\t ]*):ta:user:maathavan([\t ]*)/gi, "$1maathavanmaathavan$2");

 //Replace a long version of Reflist with Reflist
 str = str.replace(/<div[^<>]*[ ]+class=['"]*references-small['"]*[^<>]*>[\r\n]*<references[ ]*\/>[\r\n]*<\/div>/gim, '{{Reflist}}');

 return str;
}

//</source>