Module:Error: Difference between revisions

Content deleted Content added
actually, don't trim whitespace, as the original template doesn't do this
also don't bother removing whitespace values from the parameters, as the original template doesn't do this either
Line 29:
-- We're being called via #invoke. The args are passed through to the module
-- from the template page, so use the args that were passed into the template.
origArgsargs = frame.args
else
-- We're being called from another module or from the debug console, so assume
-- the args are passed in directly.
origArgsargs = frame
end
-- ParserFunctions considers whitespace to be false, so to preserve the previous
-- behavior of the template, change any arguments consisting only of whitespace
-- to nil, so Lua will consider them false too.
local args = {}
for k, v in pairs(origArgs) do
if mw.ustring.match(v, '%S') then
args[k] = v
end
end
 
return _error(args)
end