FANDOM


-- <pre>
local p = {}
 
function p.main(frame)
	local args = frame:getParent().args
 
	-- return tag
	local ret = mw.html.create('div')
				:addClass('seealso')
 
	local params = {}
	local ttl = 0
 
	-- collect and count arguments
	for _, v in ipairs(args) do
		ttl = ttl + 1
		table.insert(params,v)
	end
 
	-- main return text
	ret:wikitext('This transcript involves dialogue with ')
 
	-- for all arguments
	for i, v in ipairs(params) do
		-- add links
		if i < ttl and ttl > 1 then
			ret:wikitext('[['..v..']]')
		-- if last link
		elseif i == ttl then
			-- if only link
			if ttl == 1 then
				ret:wikitext('[['..v..']]')
			-- if final link
			else
				ret:wikitext(' and [['..v..']]')
			end
		end
 
		-- if more to come, add commas
		if i < ttl and ttl > 2 then
			ret:wikitext(', ')
		end
	end
 
	-- period
	ret:wikitext('.')
 
	return ret
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.