Anonymous user
Module:Error: Difference between revisions
simplify code some more and trim whitespace from the message
(simplify argument-grabbing code) |
(simplify code some more and trim whitespace from the message) |
||
Line 6:
local function _error(args)
local
message = mw.ustring.match(tostring(message), '^%s*(.*%S)') or '' -- Convert message to string and trim whitespace.
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
end
local root = HtmlBuilder.create(t)▼
-- Generate the html.
root
.addClass('error')
.wikitext(
return tostring(root)
Line 48 ⟶ 46:
end
return _error(args)
end
|