“模块:Lyrics”的版本间差异

删除84字节 、​ 2021年8月4日 (三) 11:43
撤销Bhsd讨论)的版本31124
(萌百发现mw.text.split对长字符串效率很低,可以换用mw.ustring.gmatch大幅改进)
标签移动版网页编辑 移动版编辑
(撤销Bhsd讨论)的版本31124)
标签撤销
 
end
end
result=result.." "..(errorFlag and "error" or "Lyrics_gradient")..'" style="background-image:-webkit-linear-gradient(left,'
local style='style="background-image:-webkit-linear-gradient(left,'
for k,name in ipairs(names) do
styleresult=styleresult..(colors[name] or 'black') --与上面的类似,加入各颜色。如果颜色不存在,则为黑色。
if k<#names then
styleresult=styleresult..','
end
end
style=stylereturn result..");"..(
return result..style..(
errorFlag and 'background:none;">[[category:Lyrics中出现错误颜色参数的页面]]Wrong color key: '..errorFlag
or '">'..module.langQuote(text:gsub('<rt>', '<rt '..style..'">'), lang)
).."</span>"
else --如果颜色标识中没有逗号,则说明只有一位角色,直接上色。
return '<span class="Lyrics_single '..(classnames[names] or names).."-lyrics"..(colors[names] and '' or " error")..
16,874

个编辑