Modul:Italic title: Forskjell mellom sideversjoner

Fra wikisida.no
Hopp til navigering Hopp til søk
forgot the namespace text
try using callParserFunction again
Linje 10: Linje 10:
         result = "''" .. title.text .. "''"
         result = "''" .. title.text .. "''"
     end
     end
     return title.nsText .. result
     if title.nsText and title.nsText ~= "" then
        result = title.nsText .. ':' .. result
    end
    return mw.getCurrentFrame():callParserFunction( 'DISPLAYTITLE', result )
end
end


return p
return p

Sideversjonen fra 17. jun. 2013 kl. 08:13

Dokumentasjon for denne modulen kan opprettes på Modul:Italic title/dok

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