Modul:Check for unknown parameters: Unterschied zwischen den Versionen

update from sandbox to sanitize displayed parameters, replacing strip markers with "<tag>...</tag>" per User talk:Johnuniq#Check for unknown parameters
K 49 Versionen von skanwiki:Modul:Check_for_unknown_parameters importiert
 
(8 dazwischenliegende Versionen von 5 Benutzern werden nicht angezeigt)
Zeile 35: Zeile 35:
end
end


function p.check (frame)
function p._check(args, pargs)
local args = frame.args
if type(args) ~= "table" or type(pargs) ~= "table" then
local pargs = frame:getParent().args
-- TODO: error handling
return
end
 
local ignoreblank = isnotempty(args['ignoreblank'])
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local showblankpos = isnotempty(args['showblankpositional'])
Zeile 86: Zeile 89:
-- add results to the output tables
-- add results to the output tables
if #values > 0 then
if #values > 0 then
if frame:preprocess( "{{REVISIONID}}" ) == "" then
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
unknown = preview
unknown = preview
end
end
Zeile 102: Zeile 105:


return table.concat(res)
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
end


return p
return p