Модул:Italic title — разлика између измена
Пређи на навигацију
Пређи на претрагу
(ажурирање) |
м (1 измена увезена) |
||
| Ред 1: | Ред 1: | ||
-- This module implements {{italic title}}. | -- This module implements {{italic title}}. | ||
local p = {} | 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("<i>%s</i> %s", prefix, parentheses) | |||
if args. | |||
else | else | ||
result = string.format("<i>%s</i>", title.text) | |||
end | end | ||
return | if title.namespace ~= 0 then | ||
result = title.nsText .. ':' .. result | |||
end | |||
return frame:callParserFunction('DISPLAYTITLE', result, args[1]) | |||
end | end | ||
function p.main(frame) | function p.main(frame) | ||
local args = require('Module:Arguments').getArgs(frame, { | |||
wrappers = 'Template:Italic title' | |||
}) | |||
return p._main(args, frame) | |||
return | |||
end | end | ||
return p | return p | ||
Верзија на датум 1. новембар 2020. у 13:48
Документацију овог модула можете да направите на страници Модул:Italic title/док
-- 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("<i>%s</i> %s", prefix, parentheses)
else
result = string.format("<i>%s</i>", 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