Skip to content

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

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

etrepum merged 3 commits into
meta: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

vercel Bot commented Feb 18, 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 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

@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.

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

@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.

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 meta:main with commit f29c06c Feb 19, 2026
37 checks passed
@etrepum etrepum mentioned this pull request Feb 25, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 50d79de4 Deployed Feb 19, 2026 by vercel[bot]
Preview – lexical — 50d79de4 Deployed Feb 19, 2026 by vercel[bot]
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