mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Feat:修改tryAddHtmlStyle方法的逻辑
This commit is contained in:
@@ -127,14 +127,15 @@ function createIconNode() {
|
||||
// 尝试给html指定标签添加内联样式
|
||||
function tryAddHtmlStyle(text, style) {
|
||||
const tagList = ['span', 'strong', 's', 'em', 'u']
|
||||
let _text = text
|
||||
for (let i = 0; i < tagList.length; i++) {
|
||||
text = addHtmlStyle(text, tagList[i], style)
|
||||
if (text !== _text) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return text
|
||||
// let _text = text
|
||||
// for (let i = 0; i < tagList.length; i++) {
|
||||
// text = addHtmlStyle(text, tagList[i], style)
|
||||
// if (text !== _text) {
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// return text
|
||||
return addHtmlStyle(text, tagList, style)
|
||||
}
|
||||
|
||||
// 创建富文本节点
|
||||
|
||||
Reference in New Issue
Block a user