Module:Error: Difference between revisions
Content deleted Content added
test for all whitespace values rather than just the blank string |
m 19 revisions imported: infobox |
||
(16 intermediate revisions by 3 users not shown) | |||
Line 1:
-- This module implements {{error}}.
local p = {}
local function _error(args)
local s = args.message or args[1] or error('no message specified', 2)▼
local tag = mw.ustring.lower(tostring(args.tag))
-- Work out what html tag we should use.
if not (tag == 'p' or tag == 'span' or tag == 'div') then
else▼
end
-- Generate the html.
▲ return tostring(root)
end
function p.error(frame)
local
if type(frame.args) ==
-- We're being called via #invoke.
--
else
-- We're being called from another module or from the debug console, so assume
-- the args are passed in directly.
end
if args.message == "" then
▲ -- them false too.
▲ args[k] = v
end
return _error(args)
end
|