Command & Conquer Wiki

Welcome to the Command & Conquer Wiki! Log in and join the community.

READ MORE

Command & Conquer Wiki
No edit summary
No edit summary
Line 5: Line 5:
 
return ""
 
return ""
 
end
 
end
local tabberArgs = {'tabber'}
+
local tabberArgs = {'tabber',''}
 
for match in string.gmatch(args[1],"File:[^%c]*") do
 
for match in string.gmatch(args[1],"File:[^%c]*") do
 
local split = mw.text.split(match, "|", true)
 
local split = mw.text.split(match, "|", true)
 
local file = mw.text.trim(split[1] or '')
 
local file = mw.text.trim(split[1] or '')
 
local desc = mw.text.trim(split[2] or '')
 
local desc = mw.text.trim(split[2] or '')
table.insert(tabberArgs,"\n|-|\n "..desc.."=\n[["..file.."|250px]]")
+
tabberArgs[2] = tabberArgs[2] .. "\n|-|\n "..desc.."=\n[["..file.."|250px]]"
 
end
 
end
 
return f:callParserFunction('#tag', tabberArgs)
 
return f:callParserFunction('#tag', tabberArgs)

Revision as of 13:33, 8 September 2019

Documentation for this module may be created at Module:SlidesToTabber/doc

local p = {}
p.main = function(f)
	local args = f:getParent().args
	if args[1] == nil then
		return ""
	end
	local tabberArgs = {'tabber',''}
	for match in string.gmatch(args[1],"File:[^%c]*") do
	    local split = mw.text.split(match, "|", true)
	    local file = mw.text.trim(split[1] or '')
	    local desc = mw.text.trim(split[2] or '')
	    tabberArgs[2] = tabberArgs[2] .. "\n|-|\n "..desc.."=\n[["..file.."|250px]]"
	end
	return f:callParserFunction('#tag', tabberArgs)
end
return p