Module:Italic title
Appearance
Henda Lua module verður nýtt á nógvum síðum síðum. Fyri at sleppa undan stórum órógvi og óneyðugum server load, so eiga allar broytingar til hesa module fyrst at verða royndar í /sandbox ella /testcases subpages. Tá ið tú hevur sæð, hvussu broytingar tínar síggja út á einari royndarsíðu, so kunnu broytingarnar goymast á hesi síðu við bert einari rætting. Vinarliga umhugsa at kjakast um ætlaðar broytingar á kjaksíðuni áðrenn tú gert broytingar her. |
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This is a Lua implementation of {{italic title}}. Please see the template page for documentation.
-- This module implements {{italic title}}.
local p = {}
function p._main(args, frame, title)
args = args or {}
frame = frame or mw.getCurrentFrame()
title = title or mw.title.getCurrentTitle()
local prefix, parentheses = mw.ustring.match(title.text, '^(.+) (%([^%(%)]+%))$')
local result
if prefix and parentheses and args.all ~= 'yes' then
result = string.format("''%s'' %s", prefix, parentheses)
else
result = string.format("''%s''", title.text)
end
if title.namespace ~= 0 then
result = title.nsText .. ':' .. result
end
return frame:callParserFunction('DISPLAYTITLE', result, args[1])
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Italic title'
})
return p._main(args, frame)
end
return p