Module:Sandbox/ChaoticShadow/InfoboxBuilder: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 252: Line 252:
local content = '?'
local content = '?'
-- local actual_args = {}
local actual_args = {}
-- for i,v in ipairs(argt) do
for _,v in ipairs(argt) do
-- local c = v.content
local c = v.content
-- if v.tag == 'argtd' then
-- c = self:getContent(c)
-- end
-- if c == nil then
-- end
-- table.insert(actual_args, i, c)
-- end
if #argt < 2 then
local v = argt[1] -- tables start at 1
content = v.content
if v.tag == 'argtd' then
if v.tag == 'argtd' then
content = self:getContent(content)
c = self:getContent(c)
end
end
if c ~= nil then
table.insert(actual_args, { title = v.title, content = c })
end
end
if #actual_args == 0 then
return self
elseif #actual_args < 2 then
content = actual_args[1].content
else
else
local t = {}
local t = {}
for i, v in ipairs(argt) do
for _,v in ipairs(actual_args) do
local c = v.content
table.insert(t, i, v.title .. "=" .. v.content)
if v.tag == 'argtd' then
c = self:getContent(c)
end
table.insert(t, i, v.title .. "=" .. c)
end
end