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 1: Line 1:
local p = {}
local p = {}
p.generate = function (frame)
p.generate = function (frame)
local output = "<ol style=\"" .. (frame.style or " ") .. "\" name=\"" .. (frame.name or " ") .. "\">"
local output = "<ol style=\"" .. (frame.style or " ") .. "\" name=\"" .. (frame.name or "") .. "\">"
for i,item in ipairs(frame.args) do
for i,item in ipairs(frame.args) do
output = output .. "<li style=\"" .. (frame.style or " ") .. "\" id=\"alist" .. (frame.name or " ") .. "-" .. i .. "\">" .. item .. "</li>"
output = output .. "<li style=\"" .. (frame.style or " ") .. "\" id=\"alist" .. (frame.name or "") .. "-" .. i .. "\">" .. item .. "</li>"
end
end

Revision as of 18:14, 28 January 2023

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