Module:template: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 3: Line 3:
local function make_template(frame, nested)
local function make_template(frame, nested)
local args = (frame:getParent() and frame:getParent().args) or frame.args
local args = (frame:getParent() and frame:getParent().args) or frame.args
local out = {"&#123;&#123;", (nested and "") or "<code>", args[1]}
local out = {(nested and "") or "<code>", "&#123;&#123;", args[1]}
local i = 2
local i = 2
while args[i] do
while args[i] do
Line 14: Line 14:
end
end
end
end
table.insert(out, ((nested and "") or "</code>") .. "&#125;&#125;")
table.insert(out, "&#125;&#125;" .. (nested and "") or "</code>")
return table.concat(out)
return table.concat(out)
end
end