Skip to content

Commit 26a4b6b

Browse files
authored
fix: fixed serialization of empty nodes (#545)
1 parent 27cfcda commit 26a4b6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/nodes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export function findFirstTextblockChild(
2323
export const isNodeEmpty = (node: Node) => {
2424
const emptyChildren = findChildren(
2525
node,
26-
(n) => (!n.isText && !n.isAtom && n.content.size === 0) || (n.isText && !n.textContent),
26+
(n) =>
27+
(!n.isText && !n.isAtom && n.content.size === 0 && n.type.name === 'paragraph') ||
28+
(n.isText && !n.textContent),
2729
true,
2830
);
2931

0 commit comments

Comments
 (0)