跳转到内容

模組:Graph:MultiChart/sandbox

维基百科,自由的百科全书

这是本页的一个历史版本,由A2569875留言 | 贡献2021年5月25日 (二) 04:33编辑。这可能和当前版本存在着巨大的差异。

local p={}
local lib_arg={}
--{{#invoke:沙盒/a2569875/Graph:MultiChart|mergeChart}}
function p.mergeChart(frame)
    local args = (type(frame) == type('')) and {frame} or ((type((frame or {}).args)==type({})) and frame.args or frame)
	local json, success = args['1'] or args[1], true
	if mw.text.trim(json) == '' then return '' end
	success, json = pcall(mw.text.jsonDecode, json, mw.text.JSON_TRY_FIXING )
	if not success then return '' end
	return mw.dumpObject(json)
end
return p