This module is rated asbeta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.
මෙම Lua moduleපිටු 473,000 පමණ භාවිතා වන නිසා. To avoid major disruption and server load, any changes should be tested in the මෙම මොඩියුලයට අදාළ/sandbox හෝ/testcases උපපිටු. The tested changes can be added to this page in a single edit. එම වෙනස්කම් සිදුකිරීමට ප්රථමඅදාළ සාකච්ඡා පිටුවේ ඒ පිළිබඳව සංවාදයක් ගොඩනැගීමට කාරුණික වන්න.Transclusion count updated automatically (ප්රලේඛනය වෙතට යොමුවන්න).
This module may be appended to a template to check for uses of tuples of conflicting parameters.
Here, (arg1a,arg1b), (arg2a,arg2b,arg2c), are tuples of the conflicting parameters.
By default, the module ignores blank parameters which is useful for {{if empty}} chains of parameters. For nested chains of parameters, use|nested=1 to consider blank parameters as well.
By default, the delimiter for the tuples is; but this can be changed with|delimiter=.
The value of|template= is used to for the text of the preview warning message. When omitted, the module will use a generic message.
localp={}localfunctiontrim(s)returns:match('^%s*(.-)%s*$')endlocalfunctionisnotempty(s)returnsands:match('%S')endfunctionp.check(frame)localargs=frame.argslocalpargs=frame:getParent().argslocalchecknested=isnotempty(args['nested'])localdelimiter=isnotempty(args['delimiter'])andargs['delimiter']or';'localcat=''ifargs['cat']andmw.ustring.match(args['cat'],'^[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]:')thencat=args['cat']endlocalres=''localargpairs={}fork,vinpairs(args)doiftype(k)=='number'thenlocalplist=mw.text.split(v,delimiter)localpfound={}localcount=0forii,vvinipairs(plist)dovv=trim(vv)ifchecknestedandpargs[vv]orisnotempty(pargs[vv])thencount=count+1table.insert(pfound,vv)endendifcount>1thentable.insert(argpairs,pfound)endendendlocalwarnmsg={}if#argpairs>0thenfori,vinipairs(argpairs)dotable.insert(warnmsg,'Using more than one of the following parameters: <code>'..table.concat(v,'</code>, <code>')..'</code>')ifcat~=''thenres=res..'[['..cat..'|'..(v[1]==''and' 'or'')..v[1]..']]'endendendif#warnmsg>0thenifframe:preprocess("{{REVISIONID}}")==""thenlocalptxt=args['template']andargs['template']..' warning'or'Warning'res='<div class="hatnote" style="color:red"><strong>'..ptxt..':</strong> '..table.concat(warnmsg,'<br>')..'</div>'..resendendreturnresendreturnp