User:Frietjes/addcheckforunknownparameters.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 53:
// Now start extracting the parameters
var plist = []; var klist = {}; var loopcount = 0;
while( (mytxt.search(/[^{}]/gm) >= 0) && (loopcount < 1516) ) {
var p = mytxt.match(/(\{\{\{[^{}\|]*\|?[^\{\}\|=]*\}\}\})/g);
if( p ) {
Line 70:
}
// Remove templates, parserfunctions, and other double brace expressions
mytxt = mytxt.replace(/([^\{])\{\{[^{}]*\}\}/gm, '$1');
mytxt = mytxt.replace(/\{\{[^{}]*\}\}([^\}])/gm, '$1');
mytxt = mytxt.replace(/([^\{])\{\{(?:[\r\n]|[^{}]|\{\{[^{}]*\}\})*\}\}/gm, '$1');
mytxt = mytxt.replace(/\{\{(?:[\r\n]|[^{}]|\{\{[^{}]*\}\})*\}\}([^\}])/gm, '$1');