From 69264e3a9df6ee952ce1aba7017e9b869d428bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Tue, 9 Jan 2024 16:08:28 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=A2=AB?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=AE=9A=E4=B9=89=E4=BA=86=E5=8A=A0=E7=B2=97?= =?UTF-8?q?=E7=9A=84=E8=8A=82=E7=82=B9=E5=88=87=E6=8D=A2=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=90=8E=E6=96=87=E6=9C=AC=E6=A0=B7=E5=BC=8F=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/node/nodeCreateContents.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simple-mind-map/src/core/render/node/nodeCreateContents.js b/simple-mind-map/src/core/render/node/nodeCreateContents.js index e9d160ec..d4e83153 100644 --- a/simple-mind-map/src/core/render/node/nodeCreateContents.js +++ b/simple-mind-map/src/core/render/node/nodeCreateContents.js @@ -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 = `
${text}
`