跳到内容

Module:沙盒/盐棋/Sandbox1:修订间差异

添加105字节 、​ 2022年7月27日 (星期三)
args
(try)
(args)
第1行: 第1行:
-- text.jsonEncode({sp=W.site.namespaces},W.text.JSON_PRETTY)
-- text.jsonEncode({sp=W.site.namespaces},W.text.JSON_PRETTY)
local p={}
local p={}
p.filter={text=mw.text.encode,json=mw.text.jsonEncode,no=function (x)return x end}
function p.label_text(text)
function p.label_text(text)
    return tostring(mw.html.create('span'):addClass('label-text'):wikitext(text))
    return tostring(mw.html.create('span'):addClass('label-text'):wikitext(text))
第22行: 第23行:
end
end
function p.direct(frame)
function p.direct(frame)
return mw.text.encode(p.tab_img(frame.arg[1],frame.arg[2]))
return p.filter[frame.args[3]](p.tab_img(frame.args[1],frame.args[2]))
end
end
function p.jsonmode(frame)
function p.jsonmode(frame)
return mw.text.encode(p.tab_img(frame.arg[1],mw.text.jsonDecode(frame.arg[2])))
return p.filter[frame.args[3]](p.tab_img(frame.args[1],mw.text.jsonDecode(frame.args[2])))
end
end
return p
return p
1,132

个编辑