Modul:Check for unknown parameters: Unterschied zwischen den Versionen
Modul:Check for unknown parameters (Quelltext anzeigen)
Version vom 2. November 2015, 11:50 Uhr
, vor 10 Jahrenfix substitution of "_VALUE_" when it isn't followed by a space
(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) |
||
| Zeile 33: | Zeile 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 | |||
local r = mw.ustring.gsub(unknown, '_VALUE_', k) | |||
table.insert(res, r) | |||
table.insert(comments, '"' .. k .. '"') | |||
end | end | ||
| Zeile 46: | Zeile 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) | |||
end | end | ||
end | end | ||