Module:Titre en italique
De Wicri Animaux
Révision datée du 28 décembre 2020 à 10:53 par imported>Jacques Ducloy (1 révision importée)
La documentation pour ce module peut être créée à Module:Titre en italique/doc
local p = {}
function p.newPagename(frame)
    local pagename = mw.title.getCurrentTitle().text
    local args = frame.args
    local lang
    if args[1] ~= '' then
        lang = args[1]
    end
    local position = pagename:find(' %(')
    local base
    local disambig
    if position then
        base = pagename:sub(1, position - 1)
        disambig = pagename:sub(position)
    else
        base = pagename
        disambig = ''
    end
    if lang then
        base = '<span lang="' .. lang .. '">' .. base .. '</span>'
    end
    return "''" .. base .. "''" .. disambig
end
return p

