Moduł:Brudnopis/Paweł Ziemian/Partie polityczne/dane

Z Wikipedii, wolnej encyklopedii

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Brudnopis/Paweł Ziemian/Partie polityczne/dane/opis

local data = {}
local group = false
for line in mw.ustring.gmatch(mw.title.new( "Paweł Ziemian/partie polityczne", "Wikipedysta" ):getContent(), "[^\n]+") do
	local h = mw.ustring.match(line, "^==%s*([^=%s].-[^=%s])%s*==$")
	if h then
		if group and group.items then
			table.insert(data, group)
		end

		group = { header = h }
	elseif group then
		local s, c, n = mw.ustring.match(line, "^%s+([^#]-)%s*#([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f])%s+(.-)%s*$")
		if s and c and n then
			if not group.items then
				group.items = {}
			end

			table.insert(group.items, { s, c, n } )
		end
	end
end

return data