“模块:标题替换”的版本间的差异
(创建页面,内容为“local module = { } function module.main(frame) local parent = frame:getParent() if parent and parent:getTitle() == "Template:Sandbox/Func/Universnal" then frame…”) |
(没有差异)
|
2022年7月10日 (日) 10:43的最新版本
此模块的文档可以在模块:标题替换/doc创建
local module = { }
function module.main(frame)
local parent = frame:getParent()
if parent and parent:getTitle() == "Template:Sandbox/Func/Universnal" then
frame = parent
end
if not frame.args[1] then
return
end
local title = frame.args[1]
local words_ustr = mw.ustring.gsub(title, "[^%a]", "")
local words_str = mw.ustring.gsub(title, "[^A-Za-z]", "")
if words_ustr == words_str then
frame:callParserFunction("DISPLAYTITLE", title)
end
return
end
return module