fix: mark 嵌套错误,无法 unwrap

This commit is contained in:
yanmao 2022-01-20 16:40:22 +08:00
parent bc3d646a0b
commit f0a15b32ee
2 changed files with 6 additions and 2 deletions

View File

@ -887,7 +887,7 @@ class Mark implements MarkModelInterface {
}
if (result) return false;
let targetNode = parent;
let targetNode = node.parent();
let curPlugin = targetNode
? this.findPlugin(targetNode)
: undefined;

View File

@ -416,7 +416,11 @@ class NodeModel implements NodeModelInterface {
if (!prev || prev.isText()) {
child.allChildren().forEach((child) => {
const text = child.text();
if (child.type === getDocument().TEXT_NODE && !!text) {
if (
child.type === getDocument().TEXT_NODE &&
!!text &&
!child.next()?.isCursor()
) {
child.text(text.replace(/\u200b/, ''));
}
});