Modul:Subrefs: Unterschied zwischen den Versionen

Aus FürthWiki

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 11: Zeile 11:


-- Try now to handle <subref> tag
-- Try now to handle <subref> tag
t = t:gsub("<subref>", "{{#tag:ref|")
t = t:gsub("%<subref>", "{{#tag:ref|")
t = t:gsub("</subref>", "}}")
t = t:gsub("%</subref>", "}}")
return frame:preprocess(t)
return frame:preprocess(t)
end
end
return p
return p

Version vom 2. Februar 2025, 20:06 Uhr

Das ist ein Workaround um das Problem, daß <ref> in Datenfeldern nicht aufgelöst wird.


local p = {} --p stands for package

function p.subrefs( frame )
	pf = frame:getParent()
	args = pf.args
	
	t = args[3]
	-- Next one works for ultra sure, imagene me DANCING!
	t = t:gsub("-ref%-", "{{#tag:ref|")
	t = t:gsub("-uref%-", "}}")

	-- Try now to handle <subref> tag
	t = t:gsub("%<subref>", "{{#tag:ref|")
	t = t:gsub("%</subref>", "}}")
	return frame:preprocess(t)
end
return p