Przejdź do zawartości

Moduł:Sandbox/Draco flavus/Test0

Z Wikiźródeł, wolnej biblioteki

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Sandbox/Draco flavus/Test0/opis

local p={}
function p.prop(frame)
	local item = mw.wikibase.getEntityObject()
	if not item then
		return ""
	end
	prop = item:formatPropertyValues(frame.args.property).value
	local pl=string.len(prop)
	if prop ~= '' then
		pos = math.min((string.find (prop, '%.[Pp][Nn][Gg], ') or pl) + 3, (string.find (prop, '%.[Jj][Pp][Gg], ') or pl) + 3, (string.find (prop, '%.[Jj][Pp][Ee][Gg], ') or pl) + 4, (string.find (prop, '%.[Gg][Ii][Ff], ') or pl) + 3, (string.find (prop, '%.[Tt][Ii][Ff], ') or pl) + 3, (string.find (prop, '%.[Tt][Ii][Ff][Ff], ') or pl) + 4)
		if pos < pl then
			return prop:sub(1, pos)
		else
			return prop
		end
	end
	return ''
end

return p