Modul:AlteSäcke: Unterschied zwischen den Versionen

Aus GaretienWiki
Zur Navigation springen Zur Suche springen
VolkoV (D | B)
VolkoV (D | B)
Zeile 13: Zeile 13:
 
local alter=robusttrim(frame.args[2])
 
local alter=robusttrim(frame.args[2])
 
local kategorie=robusttrim(frame.args[3])
 
local kategorie=robusttrim(frame.args[3])
return " "..person.."\n"
+
 +
local sch=mw.ustring.find(kategorie,"Grafschaft Schlund")~=nil
 +
local grafschaft=""
 +
if(sch) then grafschaft=grafschaft.."Schlund" end
 +
return " "..person..","..grafschaft.."\n"
 
end
 
end
 
 
 
return p
 
return p

Version vom 13. März 2019, 09:12 Uhr

Die Dokumentation für dieses Modul kann unter Modul:AlteSäcke/Doku erstellt werden

local p = {}

function robusttrim(s)
	if s==nil then return '' end
	local p=string.gsub(s,'%[%[SMW::on%]%]','')
	p=string.gsub(p,'%[%[SMW::off%]%]','')
	return mw.text.trim(p)
end
	
function p.Auswertung()
	local frame=mw.getCurrentFrame()
	local person=robusttrim(frame.args[1])
	local alter=robusttrim(frame.args[2])
	local kategorie=robusttrim(frame.args[3])
	
	local sch=mw.ustring.find(kategorie,"Grafschaft Schlund")~=nil
	local grafschaft=""
	if(sch) then grafschaft=grafschaft.."Schlund" end
	return " "..person..","..grafschaft.."\n"
end
	
return p