Module:Check for unknown parameters: Difference between revisions
Module:Check for unknown parameters (view source)
Revision as of 15:27, 18 November 2021
, 18 November 2021update to allow check for unnamed parameters, code by User:Frietjes
m (1 revision imported) |
(update to allow check for unnamed parameters, code by User:Frietjes) |
||
Line 69: | Line 69: | ||
table.insert(values, clean(k)) | table.insert(values, clean(k)) | ||
end | end | ||
elseif type(k) == 'number' and | elseif type(k) == 'number' and knownargs[tostring(k)] == nil then | ||
local knownflag = false | |||
( showblankpos or isnotempty(v) ) | for _, regexp in ipairs(regexps) do | ||
if mw.ustring.match(tostring(k), regexp) then | |||
knownflag = true | |||
break | |||
end | |||
end | |||
if not knownflag and ( showblankpos or isnotempty(v) ) then | |||
table.insert(values, k .. ' = ' .. clean(v)) | |||
end | |||
end | end | ||
end | end |