Feat:修改tryAddHtmlStyle方法的逻辑
This commit is contained in:
parent
508d8fe357
commit
fbb3b47b7d
@ -127,14 +127,15 @@ function createIconNode() {
|
|||||||
// 尝试给html指定标签添加内联样式
|
// 尝试给html指定标签添加内联样式
|
||||||
function tryAddHtmlStyle(text, style) {
|
function tryAddHtmlStyle(text, style) {
|
||||||
const tagList = ['span', 'strong', 's', 'em', 'u']
|
const tagList = ['span', 'strong', 's', 'em', 'u']
|
||||||
let _text = text
|
// let _text = text
|
||||||
for (let i = 0; i < tagList.length; i++) {
|
// for (let i = 0; i < tagList.length; i++) {
|
||||||
text = addHtmlStyle(text, tagList[i], style)
|
// text = addHtmlStyle(text, tagList[i], style)
|
||||||
if (text !== _text) {
|
// if (text !== _text) {
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return text
|
// return text
|
||||||
|
return addHtmlStyle(text, tagList, style)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建富文本节点
|
// 创建富文本节点
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user