跳转到内容

维基百科:AutoEd/templates.js

维基百科,自由的百科全书

这是Wikipedia:AutoEd/templates.js当前版本,由Bencmq留言 | 贡献编辑于2009年5月14日 (四) 14:07 建立内容为“//<source lang=javascript> function autoEdTemplates(str) { //MAIN FUNCTION describes list of fixes //Replace redirects to Reflist with Reflist …”的新页面)。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

//

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

    //Replace redirects to Reflist with Reflist
    str = str.replace(new RegExp('\{\{REFERENCE|\{\{REFS|\{\{REFERENCE LIST|\{\{REFERENCES-SMALL|\{\{REFLINK|\{\{LISTAREF|\{\{REFERENCE LIST|\{\{REF-LIST', 'gi'), '\{\{Reflist');

    //Replace a long version of Reflist with Reflist
    str = str.replace(new RegExp('<div class=\'references-small\'>\n<references \/>\n<\/div>|<div class=\'references-small\'>\n<references\/>\n<\/div>', 'gi'), '\{\{Reflist\}\}');

    //Remove unneeded Template: text from transclusions
    str = str.replace(new RegExp('\{\{TEMPLATE:', 'gi'), '\{\{');

    return str;
}

//