Modul:Italic title: Unterschied zwischen den Versionen

Aus skandinavien-wiki.net
(create a replacement for Template:Italic title)
 
(try with callParserFunction instead)
Zeile 10: Zeile 10:
         result = "''" .. title.text .. "''"
         result = "''" .. title.text .. "''"
     end
     end
     result = '{{DISPLAYTITLE:' .. title.nsText .. result .. '}}'
     return mw.getCurrentFrame():callParserFunction( 'DISPLAYTITLE', title.nsText .. result )
    return mw.getCurrentFrame:preprocess(result)
end
end


return p
return p

Version vom 17. Juni 2013, 08:58 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
    return mw.getCurrentFrame():callParserFunction( 'DISPLAYTITLE', title.nsText .. result )
end

return p