LLWiki正在建设中,欢迎加入我们

“MediaWiki:Gadget-Cat-a-lot.js”的版本间差异

跳转到导航 跳转到搜索
添加32字节 、​ 2020年8月26日 (三) 04:45
无编辑摘要
 
// Make the first character case-insensitive:
//var first = category.substr( 0, 1 );
//if ( first.toUpperCase() !== first.toLowerCase() ) { category = '[' + first.toUpperCase() + first.toLowerCase() + ']' + category.substr( 1 ); }
 
// 繁简转换
if ( window.CatALotSourceCat && window.CatALotSourceCat.includes(category) ) {
category = '(?:' + window.CatALotSourceCat.join('|') + ')';
}
}
 
// Compile it into a RegExp that matches MediaWiki category syntax (yeah, it looks ugly):
// XXX: the first capturing parens are assumed to match the sortkey, if present, including the | but excluding the ]]
return new RegExp( '\\[\\[[\\s_]*' + catname + '[\\s_]*:[\\s_]*' + category + '[\\s_]*(\\|[^\\]]*(?:\\][^\\]]+)*)?\\]\\]\\s*', 'ggi' );
},
 
16,874

个编辑

导航菜单