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