Modul:Italic title: Unterschied zwischen den Versionen
(forgot the namespace text) |
(try using callParserFunction again) |
||
| Zeile 10: | Zeile 10: | ||
result = "''" .. title.text .. "''" | result = "''" .. title.text .. "''" | ||
end | end | ||
if title.nsText and title.nsText ~= "" then | |||
result = title.nsText .. ':' .. result | |||
end | |||
return mw.getCurrentFrame():callParserFunction( 'DISPLAYTITLE', result ) | |||
end | end | ||
return p | return p | ||
Version vom 17. Juni 2013, 09:13 Uhr
Die Dokumentation für dieses Modul kann unter Modul:Italic title/doc erstellt werden
local p = {}
function p.main()
local title = mw.title.getCurrentTitle()
local prefix, brackets = mw.ustring.match(title.text, '(.+) (%([^%(%)]+%))$')
local result
if prefix and brackets then
result = "''" .. prefix .. "'' " .. brackets
else
result = "''" .. title.text .. "''"
end
if title.nsText and title.nsText ~= "" then
result = title.nsText .. ':' .. result
end
return mw.getCurrentFrame():callParserFunction( 'DISPLAYTITLE', result )
end
return p