Module:List: Difference between revisions

From Vintage Story Wiki
mNo edit summary
mNo edit summary
Line 3: Line 3:
local args = f.args
local args = f.args
local listItems = args[1]:match(';')
local listItems = args[1]:match(';')
if v:match(';') then
listItems[k] = '<li>' .. v .. '</li>'
end
local list = table.concat(listItems, '\n')
local list = table.concat(listItems, '\n')
local html = {
local html = {

Revision as of 21:36, 17 August 2022

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

local p = {}
function p.list( f )
	local args = f.args
	local listItems = args[1]:match(';')
	local list = table.concat(listItems, '\n')
	local html = {
		'<ol style="list-style-type: none; margin: 0; padding: 0;">',
			list,
		'</ol>'
	}
	return table.concat(html, '\n')
end
return p