模块:Zhchar:修订间差异

添加112字节 、​ 2024年3月17日 (星期日)
//Edit via InPageEdit
(//Edit via InPageEdit)
(//Edit via InPageEdit)
第1行:
local p = {}
p.zhchar = function(framef)
 
local args = framef
p.zhchar = function(frame)
if f == mw.getCurrentFrame() then
local args = frame
if frame = args = mw.getCurrentFramef:getParent() then.args
args = frame:getParent().args
end
 
local zhchar = {}
 
第14行 ⟶ 第12行:
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 mw.text.unstrip(table.concat(zhchar))
end
 
p.key = function(key, f)
if key == '' then
return ''
第31行 ⟶ 第29行:
 
local symbols = mw.loadData('Module:Zhchar/Symbols')
returnlocal value = mw.text.unstrip(symbols[key] or key)
if mw.ustring.match(value, '{{RareChar') then
value = f:expandTemplate{ title = 'RareChar', args = { value } }
end
return value
end
 
2,007

个编辑