Jump to content

Module:Anchored list: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Afkirby (talk | contribs)
No edit summary
Afkirby (talk | contribs)
No edit summary
Line 2: Line 2:
p.generate = function (frame)
p.generate = function (frame)
local i = 0
local i = 0
local output = "<ol style=\"" .. frame.style .. "\" name=\"" .. name .. "\">"
local output = "<ol style=\"" .. (frame.style or "") .. "\" name=\"" .. (frame.name or "") .. "\">"
for item in frame.args do
for item in frame.args do
i = i + 1
i = i + 1
output = output .. "<li style=\"" .. frame.style .. "\" id=\"alist" .. frame.name .. "-" .. i .. "\">" .. item .. "</li>"
output = output .. "<li style=\"" .. (frame.style or "") .. "\" id=\"alist" .. (frame.name or "") .. "-" .. i .. "\">" .. item .. "</li>"
end
end
return output .. "</ol>"
return output .. "</ol>"
end
end
return p

Revision as of 18:08, 28 January 2023

local p = {}
p.generate = function (frame)
	local i = 0
	local output = "<ol style=\"" .. (frame.style or "") .. "\" name=\"" .. (frame.name or "") .. "\">"
	for item in frame.args do
		i = i + 1
		output = output .. "<li style=\"" .. (frame.style or "") .. "\" id=\"alist" .. (frame.name or "")  .. "-" .. i .. "\">" .. item .. "</li>"
	end
	
	return output .. "</ol>"
end
return p