Jump to content

Module:Italic title

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 08:03, 17 June 2013 (forgot the namespace text). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 title.nsText .. result
end

return p