mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Fix:修复粘贴<a格式的文本生成节点后,文本显示<a的问题
This commit is contained in:
@@ -1206,7 +1206,10 @@ class Render {
|
||||
Array.isArray(smmData) ? smmData : [smmData]
|
||||
)
|
||||
} else {
|
||||
text = htmlEscape(text)
|
||||
// 如果是富文本模式,那么需要转义特殊字符
|
||||
if (this.hasRichTextPlugin()) {
|
||||
text = htmlEscape(text)
|
||||
}
|
||||
const textArr = text
|
||||
.split(new RegExp('\r?\n|(?<!\n)\r', 'g'))
|
||||
.filter(item => {
|
||||
|
||||
@@ -8,7 +8,8 @@ import {
|
||||
checkSmmFormatData,
|
||||
formatGetNodeGeneralization,
|
||||
nodeRichTextToTextWithWrap,
|
||||
getNodeRichTextStyles
|
||||
getNodeRichTextStyles,
|
||||
htmlEscape
|
||||
} from '../utils'
|
||||
import { CONSTANTS, richTextSupportStyleList } from '../constants/constant'
|
||||
import MindMapNode from '../core/render/node/MindMapNode'
|
||||
@@ -760,20 +761,24 @@ class RichText {
|
||||
this.afterHandleData()
|
||||
}
|
||||
|
||||
handleDataToRichText(data) {
|
||||
data.richText = true
|
||||
data.resetRichText = true
|
||||
data.text = htmlEscape(data.text)
|
||||
}
|
||||
|
||||
// 处理导入数据
|
||||
handleSetData(data) {
|
||||
const walk = root => {
|
||||
if (root.data && !root.data.richText) {
|
||||
root.data.richText = true
|
||||
root.data.resetRichText = true
|
||||
this.handleDataToRichText(root.data)
|
||||
}
|
||||
// 概要
|
||||
if (root.data) {
|
||||
const generalizationList = formatGetNodeGeneralization(root.data)
|
||||
generalizationList.forEach(item => {
|
||||
if (!item.richText) {
|
||||
item.richText = true
|
||||
item.resetRichText = true
|
||||
this.handleDataToRichText(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user