Skip to content

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

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

etrepum merged 3 commits into
meta:mainfrom
achaljhawar:fix/autolink-exclude-code-blocks

Conversation

@achaljhawar

@achaljhawar achaljhawar commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

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

vercel Bot commented Feb 9, 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 10, 2026 4:43pm
lexical-playground Ready Ready Preview, Comment Feb 10, 2026 4:43pm

Request Review

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

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 meta:main with commit 4b70f58 Feb 10, 2026
34 checks passed
@etrepum etrepum mentioned this pull request Feb 25, 2026

This branch was successfully deployed

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