WikiBuilder
329
次編輯
小無編輯摘要 |
小無編輯摘要 |
||
第44行: | 第44行: | ||
--- 构建HTML --- | --- 构建HTML --- | ||
local span = mw.html.create("span"); | local span = mw.html.create("span"); | ||
local a = list[args[1]]; | |||
if type(a) == 'nil' then | |||
span:css('color',(args[1] or 'unset')):wikitext(args[2]); | |||
elseif type(a) == 'string' then | |||
span:addClass(a):wikitext(args[1]); | |||
elseif type(a) == 'function' then | |||
a(span); | |||
end | |||
if args['style'] then span:attr('style',args['style']) end | if args['style'] then span:attr('style',args['style']) end |