Skip to content

[lexical] Fix : Replaced the function $insertNodes with $insertNodeIntoLeaf for consistent behavior of Decorator Node within MarkNode#8266

Merged
etrepum merged 33 commits into
facebook:mainfrom
Jynx2004:equation_issue_fix
Mar 28, 2026
Merged

[lexical] Fix : Replaced the function $insertNodes with $insertNodeIntoLeaf for consistent behavior of Decorator Node within MarkNode#8266
etrepum merged 33 commits into
facebook:mainfrom
Jynx2004:equation_issue_fix

Conversation

@Jynx2004

Copy link
Copy Markdown
Contributor

Description

  • The problem is that $insertNodes currently won't insert into an inline ElementNode for historical reasons.
  • Using the markdown shortcut to change the text into an equation does a more direct replacement of the text and never had this issue.
  • We replaced the $insertNodes function with $insertNodeIntoLeaf function which results in expected behavior.

Closes #7231

Screenshot 2026-03-28 110735

Test plan

Added a unit test to test the expected behavior

@vercel

vercel Bot commented Mar 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 28, 2026 4:01pm
lexical-playground Ready Ready Preview, Comment Mar 28, 2026 4:01pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 28, 2026

@etrepum etrepum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good but the tests can be cleaned up a bit

Comment thread packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts Outdated
Comment thread packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts Outdated
Comment thread packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts Outdated
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Mar 28, 2026
Jynx2004 and others added 4 commits March 28, 2026 20:39
Co-authored-by: Bob Ippolito <bob@redivi.com>
Co-authored-by: Bob Ippolito <bob@redivi.com>
Co-authored-by: Bob Ippolito <bob@redivi.com>
@Jynx2004

Copy link
Copy Markdown
Contributor Author

The change itself looks good but the tests can be cleaned up a bit

Working on it

Comment thread packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts Outdated
Comment thread packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts Outdated
@etrepum etrepum added this pull request to the merge queue Mar 28, 2026
Merged via the queue into facebook:main with commit 548e53e Mar 28, 2026
40 checks passed
@etrepum etrepum mentioned this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: inconsistent behavior of DecoratorNode within MarkNode

2 participants