feat: isEmpty
This commit is contained in:
parent
7f290e70c8
commit
7d3164aac5
|
@ -286,10 +286,14 @@ class ChangeModel implements ChangeInterface {
|
|||
isEmpty() {
|
||||
const { container, node, schema } = this.engine;
|
||||
const tags = schema.getAllowInTags();
|
||||
const children = container.children();
|
||||
return (
|
||||
container.children().length === 1 &&
|
||||
node.isEmpty(container) &&
|
||||
!container.allChildren().some((child) => tags.includes(child.name))
|
||||
children.length === 0 ||
|
||||
(children.length === 1 &&
|
||||
node.isEmpty(container) &&
|
||||
!container
|
||||
.allChildren()
|
||||
.some((child) => tags.includes(child.name)))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue