Skip to content

Commit

Permalink
fix: fixed serialization of empty nodes (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFFaT authored Jan 13, 2025
1 parent 27cfcda commit 26a4b6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function findFirstTextblockChild(
export const isNodeEmpty = (node: Node) => {
const emptyChildren = findChildren(
node,
(n) => (!n.isText && !n.isAtom && n.content.size === 0) || (n.isText && !n.textContent),
(n) =>
(!n.isText && !n.isAtom && n.content.size === 0 && n.type.name === 'paragraph') ||
(n.isText && !n.textContent),
true,
);

Expand Down

0 comments on commit 26a4b6b

Please # to comment.