Skip to content

Commit

Permalink
[lexical-list] Bug Fix: Handle appending inline element nodes in List…
Browse files Browse the repository at this point in the history
…Node.append (#6791)
  • Loading branch information
amanharwara authored Nov 11, 2024
1 parent fd4aca7 commit 2bdaed5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/lexical-list/src/LexicalListNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ export class ListNode extends ElementNode {
if ($isListNode(currentNode)) {
listItemNode.append(currentNode);
} else if ($isElementNode(currentNode)) {
const textNode = $createTextNode(currentNode.getTextContent());
listItemNode.append(textNode);
if (currentNode.isInline()) {
listItemNode.append(currentNode);
} else {
const textNode = $createTextNode(currentNode.getTextContent());
listItemNode.append(textNode);
}
} else {
listItemNode.append(currentNode);
}
Expand Down

0 comments on commit 2bdaed5

Please sign in to comment.