Hoppa till innehållet

Modul:Formatering

Från Wikipedia
Version från den 6 mars 2015 kl. 01.09 av Larske (Diskussion | Bidrag) (+funktion un_bulleted_list)

Dokumentationen för denna modul kan skapas på Modul:Formatering/dok

local p = {}

function p.br_separated_entries(frame)
	local res = ''
	for _, v in ipairs(frame:getParent().args) do	
	  if string.gsub(v,' ','') ~= '' then  res = res .. v .. '<br />' end
	end
    return string.sub(res,1,-7)
end

function p.un_bulleted_list(frame)
	local args = frame:getParent().args
	local ul_style = args['ul_style'] or ''
	local res = '<div class="plainlist"><ul style="list-style:none; none;' .. ul_style .. '">'
	local li_style = args['li_style'] or ''
	for i, v in ipairs(args) do
		li_style_i = args['li_style'..i] or ''
		if string.gsub(v,' ','') ~= '' then res = res .. '<li style="' .. li_style .. li_style_i .. '">' .. v .. '</li>' end
	end
    return res..'</ul></div>'
end
    
return p