fix: 错误的删除了span不为空的节点

This commit is contained in:
yanmao 2021-12-08 16:41:32 +08:00
parent 946c0af0b0
commit 524843e04b
1 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,10 @@ export default class Paste {
}
// 删除空 span
while (node.name === 'span' && nodeApi.isEmpty(node)) {
const children = node.children();
if (children.length > 0 && children.isElement()) {
break;
}
parent = node.parent();
node.remove();
if (!parent) return;