Skip to content

Commit

Permalink
fix(tables): Add missing paragraph node when copying empty cells from…
Browse files Browse the repository at this point in the history
… external resources
  • Loading branch information
vect-spasquereau committed Feb 29, 2024
1 parent ee83ac2 commit 9aee91d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/lexical-table/src/LexicalTableCellNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ export function convertTableCellNodeElement(
}

return {
after: (childLexicalNodes) => {
if (childLexicalNodes.length === 0) {
childLexicalNodes.push($createParagraphNode());
}
return childLexicalNodes;
},
forChild: (lexicalNode, parentLexicalNode) => {
if ($isTableCellNode(parentLexicalNode) && !$isElementNode(lexicalNode)) {
const paragraphNode = $createParagraphNode();
Expand Down

0 comments on commit 9aee91d

Please sign in to comment.