「模組:Italic title」調整以後𣍐蜀樣其地方

刪去的內容 新增的內容
Sĭng hiĕk: -- 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.g...
 
(Mò̤ chă)

2015 nièng 8 nguŏk 20 hô̤ (B4) 07:18 muōi-muōi siŏh-huôi biĕng-cĭk

可在模組:Italic title/doc建立此模組的說明文件

-- 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