Skip to content

[lexical-playground] Bug Fix: Code block formatting in unintended adjacent lines #8149

Merged
etrepum merged 3 commits intofacebook:mainfrom
achaljhawar:fix/code-block-formatting
Feb 19, 2026
Merged

[lexical-playground] Bug Fix: Code block formatting in unintended adjacent lines #8149
etrepum merged 3 commits intofacebook:mainfrom
achaljhawar:fix/code-block-formatting

Conversation

@achaljhawar
Copy link
Copy Markdown
Contributor

Description

Code block formatting was pulling in unselected content after line breaks, this pr fixes this problem by splitting paragraphs at line break boundaries before conversion.

Closes #7691

Before

Lexical.Playground.4.mp4

After

Lexical.Playground.5.mp4

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 18, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Feb 19, 2026 5:40pm
lexical-playground Ready Ready Preview, Comment Feb 19, 2026 5:40pm

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 Feb 18, 2026
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

This PR should also include a test to confirm that the problem is fixed.

Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

This does have the probably undesired effect of converting all LineBreakNode in the selection's blocks to new ParagraphNodes, rather than the ones inside or bordering the selection. Overall nice work!

@etrepum etrepum added this pull request to the merge queue Feb 19, 2026
Merged via the queue into facebook:main with commit f29c06c Feb 19, 2026
39 checks passed
@etrepum etrepum mentioned this pull request Feb 25, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Code Block formatting applies to unintended adjacent lines

2 participants