Prijeđi na sadržaj

Modul:DZ+X/plainlist

Izvor: Wikipedija
local p = {}

function p.main(frame)
	local argsList = mw.getCurrentFrame():getParent().args[1]
	
	local zastava = require('Module:Zastava').zastava
	
	local args={}
	
	local plainlistStart = "<div class=\"plainlist \">"
	local plainlistEnd = "</div>"
	local space = "<span style=\"visibility:hidden; color:transparent;\">0</span>"
	local text = plainlistStart
	
	for str in string.gmatch(argsList, "([^,]+)") do
		text = text .. "\n* "
		local _, indentation = str:gsub("*","")
		
		text = text .. string.rep(space, indentation)
		
		str = str:match'^%s*(.*)'
		local z = string.gsub(str, "%*", "")
		
		local args = {}
		args.kratica = z
		args.wp = 1
		text = text .. zastava(args)
 	end -- for
	
	text = text .. plainlistEnd
	
	return text
end -- function
return p