Module:Check for unknown parameters: Difference between revisions

update 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
knownargs[tostring(k)] == nil and
local knownflag = false
( showblankpos or isnotempty(v) )
for _, regexp in ipairs(regexps) do
then
if mw.ustring.match(tostring(k), regexp) then
table.insert(values, k .. ' = ' .. clean(v))
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
Anonymous user