Modul:TemplUtl: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
2019-06-06
(2019-02-20) |
(2019-06-06) |
||
Zeile 1: | Zeile 1: | ||
local TemplUtl = { suite = "TemplUtl", | local TemplUtl = { suite = "TemplUtl", | ||
serial = "2019- | serial = "2019-06-06" }; | ||
Zeile 168: | Zeile 168: | ||
TemplUtl.fake = function ( access | TemplUtl.fake = function ( access ) | ||
-- Simulation of template transclusion | -- Simulation of template transclusion | ||
-- Precondition: | -- Precondition: | ||
-- access -- string | -- access -- string; page name (template) | ||
if type( access ) == "string" then | if type( access ) == "string" then | ||
s = mw.text.trim( access ); | local s = mw.text.trim( access ); | ||
if s | if s ~= "" then | ||
s | local t = mw.title.new( s, 10 ); | ||
if not mw.title.equals( mw.title.getCurrentTitle(), t ) and | |||
t.exists then | |||
t.getContent(); | |||
end | |||
end | end | ||
end | end | ||
end -- TemplUtl.fake() | end -- TemplUtl.fake() |