Skip to content

Commit

Permalink
[lexical-list] Handle appending inline element nodes in ListNode.append
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Nov 4, 2024
1 parent b4eba9e commit 5d377c9
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 5d377c9

Please sign in to comment.