మాడ్యూల్:Italic title: కూర్పుల మధ్య తేడాలు
Jump to navigation
Jump to search
Content deleted Content added
imported>Izkala Use <i> to italicise apostrophes, per ER |
replace underscores with spaces in namespace names |
||
పంక్తి 15: | పంక్తి 15: | ||
end |
end |
||
if title.namespace ~= 0 then |
if title.namespace ~= 0 then |
||
result = title.nsText .. ':' .. result |
result = title.nsText:gsub('_', ' ') .. ':' .. result |
||
end |
end |
||
return frame:callParserFunction('DISPLAYTITLE', result, args[1]) |
return frame:callParserFunction('DISPLAYTITLE', result, args[1]) |
23:06, 19 ఏప్రిల్ 2016 నాటి కూర్పు
-- 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:gsub('_', ' ') .. ':' .. 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