From 0d4cbc7344a700ce8233700ef5c4a8a539a44b83 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Mon, 20 Nov 2023 15:46:33 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=86=85=E5=AE=B9=E4=B8=BAhtml=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=97=B6=E5=A4=A7=E7=BA=B2=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=BE=91=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/utils/index.js | 2 +- web/src/pages/Edit/components/Outline.vue | 6 ++++-- web/src/pages/Edit/components/OutlineEdit.vue | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/simple-mind-map/src/utils/index.js b/simple-mind-map/src/utils/index.js index 228516d1..8541ff93 100644 --- a/simple-mind-map/src/utils/index.js +++ b/simple-mind-map/src/utils/index.js @@ -629,7 +629,7 @@ export const textToNodeRichTextWithWrap = html => { } return list .map(item => { - return `
${item}
` + return `${htmlEscape(item)}
` }) .join('') } diff --git a/web/src/pages/Edit/components/Outline.vue b/web/src/pages/Edit/components/Outline.vue index 234d60ef..c6ba3b30 100644 --- a/web/src/pages/Edit/components/Outline.vue +++ b/web/src/pages/Edit/components/Outline.vue @@ -42,7 +42,8 @@ import { nodeRichTextToTextWithWrap, textToNodeRichTextWithWrap, getTextFromHtml, - createUid + createUid, + htmlEscape } from 'simple-mind-map/src/utils' // 大纲树 @@ -129,10 +130,11 @@ export default { let data = this.mindMap.getData() data.root = true // 标记根节点 let walk = root => { - const text = (root.data.richText + let text = (root.data.richText ? nodeRichTextToTextWithWrap(root.data.text) : root.data.text ).replaceAll(/\n/g, '