此模块没有文档页面。如果你知道此模块的使用方法,请帮助为其创建文档页面。
local p = {}
p.zhchar = function(f)
local args = f
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
local zhchar = {}
for _, key in ipairs(args) do
key = mw.text.trim(key)
if key ~= '+' and key:find('%+') then
local combozhchar = {}
for comboKey in mw.text.gsplit(key, '%s*%+%s*') do
table.insert(combozhchar, p.key(comboKey, f))
end
table.insert(zhchar, table.concat(combozhchar, ' + '))
else
table.insert(zhchar, p.key(key, f))
end
end
return table.concat(zhchar)
end
p.key = function(key, f)
if key == '' then
return ''
end
local symbols = mw.loadData('Module:Zhchar/Symbols')
local value = symbols[key] or key
if mw.ustring.match(value, '{{RareChar') then
value = f:expandTemplate{ title = 'RareChar', args = { value } }
end
return value
end
return p