Module:Check for unknown parameters: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(fix odd bug for | = which gets stripped to nothing, and Category:Foo is broken) |
(fix substitution of "_VALUE_" when it isn't followed by a space) |
||
Line 33: | Line 33: | ||
end |
end |
||
end |
end |
||
end |
|||
local function addresult(k) |
|||
if k == '' then |
|||
-- Fix odd bug for | = which gets stripped to the empty string and |
|||
-- breaks category links |
|||
k = ' ' |
|||
end |
|||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
Line 46: | Line 57: | ||
if( (not knownflag) and ( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) ) then |
if( (not knownflag) and ( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) ) then |
||
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') |
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') |
||
addresult(k) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
elseif(checkpos and type(k) == 'number' and knownargs[tostring(k)] == nil) then |
elseif(checkpos and type(k) == 'number' and knownargs[tostring(k)] == nil) then |
||
if( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) then |
if( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) then |
||
addresult(k) |
|||
local r = mw.ustring.gsub(unknown, '_VALUE_ ', k) |
|||
table.insert(res, r) |
|||
table.insert(comments, '"' .. k .. '"') |
|||
end |
end |
||
end |
end |