Fix:修复被主题定义了加粗的节点切换主题后文本样式丢失的问题

This commit is contained in:
街角小林 2024-01-09 16:08:28 +08:00
parent d8fdc37684
commit 69264e3a9d

View File

@ -128,7 +128,12 @@ function createRichTextNode() {
// 如果是富文本那么线移除内联样式
text = removeHtmlStyle(text)
// 再添加新的内联样式
let _text = text
text = addHtmlStyle(text, 'span', style)
// 给span添加样式没有成功则尝试给strong标签添加样式
if (text === _text) {
text = addHtmlStyle(text, 'strong', style)
}
} else {
// 非富文本
text = `<p><span style="${style}">${text}</span></p>`