"मोड्युल:Italic title" का संशोधनहरू बिचको अन्तर

allow this to be called from Lua, and make it more compact
(allow the ability to specify the "noerror" parameter)
(allow this to be called from Lua, and make it more compact)
local p = {}
 
function p.main_main(args, frame, title)
args = args or {}
local args = require('Module:Arguments').getArgs(frame, {
frame = frame or mw.getCurrentFrame()
wrappers = 'Template:Italic title'
local title = title or mw.title.getCurrentTitle()
})
local title = mw.title.getCurrentTitle()
 
-- Find the parts before and after the disambiguation parentheses, if any.
local prefix, parentheses = mw.ustring.match(title.text, '^(.+) (%([^%(%)]+%))$')
 
-- If parentheses were found, italicise only the part before them. Otherwise
-- italicise the whole title.
local result
if prefix and parentheses and args.all ~= 'yes' then
result = string.format("''" .. prefix .. "%s'' %s", ..prefix, parentheses)
else
result = string.format("''%s''" .., title.text .. "''")
end
 
-- Add the namespace if we're not in mainspace.
if title.namespace ~= 0 then
result = mw.site.namespaces[title.namespace].namensText .. ':' .. result
end
return frame:callParserFunction('DISPLAYTITLE', result, args[1])
end
 
function p.main(frame)
-- Call displaytitle with the text we generated.
local args = require('Module:Arguments').getArgs(frame, {
return mw.getCurrentFrame():callParserFunction(
wrappers = 'Template:Italic title'
'DISPLAYTITLE',
})
result,
return p._main(args, frame)
args[1]
end
)
end
 
return p
"https://ne.wikipedia.org/wiki/विशेष:MobileDiff/549849" बाट अनुप्रेषित