模块:Utils:修订间差异

添加476字节 、​ 2024年2月3日 (星期六)
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"
Lz讨论 | 贡献
(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")
(没有差异)
2,088

个编辑