2,088
个编辑
(Created page with "local p = {} function p.for_each(frame) local template = frame.args[1]:gsub('\\n', '\n') local ret = '' for i, arg in ipairs(frame.args) do if i > 1 then local text = template:gsub('%(%(%(1%)%)%)', arg) ret = ret .. text end end return frame:preprocess(ret) end function p.d() local frame = { args = { 'hello (((1)))\n', 'x', 'y', 'z' } } local r = p.for_each(frame) mw.log(r) end return p") |
(没有差异)
|