Hoppa till innehållet

Modul:Formatering

Från Wikipedia
Version från den 8 mars 2015 kl. 12.34 av 90.227.135.41 (Diskussion) (äldre IE behöver två none för att punkten ska försvinna helt)

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.unbulleted_list(frame)
	local args = frame:getParent().args
	local class = args['class'] or 'plainlinks'
	local style = args['style'] or ''
	local list_style = args['list_style'] or 'margin-left:0; list-style:none none;'
	local item_style = args['item_style'] or ''
	local res = '<div class="' .. class .. '" style="' .. style .. '"><ul style="' .. list_style .. '">'
	for i, v in ipairs(args) do
		itemi_style = args['item' .. i .. '_style'] or ''
		if string.gsub(v,' ','') ~= '' then res = res .. '<li style="' .. item_style .. itemi_style .. '">' .. v .. '</li>' end
	end
    return res..'</ul></div>'
end
    
return p