Skip to content

[lexical-link] Bug Fix: Prevent AutoLink from linking URLs inside code blocks#8123

Merged
etrepum merged 3 commits intofacebook:mainfrom
achaljhawar:fix/autolink-exclude-code-blocks
Feb 10, 2026
Merged

[lexical-link] Bug Fix: Prevent AutoLink from linking URLs inside code blocks#8123
etrepum merged 3 commits intofacebook:mainfrom
achaljhawar:fix/autolink-exclude-code-blocks

Conversation

@achaljhawar
Copy link
Copy Markdown
Contributor

@achaljhawar achaljhawar commented Feb 9, 2026

Description

  • Plain TextNodes inside CodeNode pass isSimpleText(), so the auto-link transform wraps them in AutoLinkNode.
  • Adds excludeParents to AutoLinkConfig, an array of predicates that skip the auto-link transform when the parent node matches.

Closes #8028

Before

Screenshot 2026-02-09 at 4 53 59 PM

After

Screenshot 2026-02-09 at 4 55 54 PM

@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 9, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Feb 10, 2026 4:43pm
lexical-playground Ready Ready Preview, Comment Feb 10, 2026 4:43pm

Request Review

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.

Looks like this is failing existing e2e tests

@etrepum etrepum added this pull request to the merge queue Feb 10, 2026
Merged via the queue into facebook:main with commit 4b70f58 Feb 10, 2026
36 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. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AutoLink produces links inside non-highlighted code-blocks

2 participants