Module:TemplateStructure: Difference between revisions
No edit summary Tag: Reverted |
Tag: Undo |
||
| Line 30: | Line 30: | ||
local blocks = config.blocks or {} | local blocks = config.blocks or {} | ||
-- Begin the table markup. | |||
local result = {} | local result = {} | ||
table.insert(result, string.format('{| class="%s" %s', tableClass, tableAttrs)) | |||
table.insert(result, string.format('{| class="%s" %s | |||
-- Process each block function in the supplied order. | |||
for i, block in ipairs(blocks) do | for i, block in ipairs(blocks) do | ||
if type(block) == "function" then | if type(block) == "function" then | ||
| Line 46: | Line 47: | ||
end | end | ||
table.insert(result, "|}") | |||
table.insert(result, " | |||
local finalOutput = table.concat(result, "") | local finalOutput = table.concat(result, "\n") | ||
return trim(finalOutput) | return trim(finalOutput) | ||
end | end | ||
return p | return p | ||