Skip to content

[lexical-markdown] Bug Fix: Ensure First Match is Used in importTextMatchTransformer - #7890

Merged
etrepum merged 2 commits into
meta:mainfrom
jkjk822:patch-2
Sep 30, 2025
Merged

etrepum merged 2 commits into
meta:mainfrom
jkjk822:patch-2

Conversation

@jkjk822

@jkjk822 jkjk822 commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Description

Ensure we use the first match if there are multiple on a line (when "outermost" is ambiguous), rather than just the match from the first transformer that ran on the line.

This prevents cases where there is a TextFormatTransformer match in an earlier TextMatchTransformer. The TextFormatTransformer will segment the earlier TextMatchTransformer so that it is never parsed correct. See added test for an example that failed before this fix (the link would not be parsed and the raw link markdown was present in the final output).

Test plan

Before

Added test failed

After

Added test passes

Ensure we use the first match if there are multiple on a line (when "outermost" is ambiguous), rather than just the match from the first transformer that ran on the line.

This prevents cases where there is a `TextFormatTransformer` match in an earlier `TextMatchTransformer`. The `TextFormatTransformer` will segment the earlier `TextMatchTransformer` so that it is never parsed correct. See added test for an example that failed before this fix (the link would not be parsed and the raw link markdown was present in the final output).
@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 Sep 30, 2025
@vercel

vercel Bot commented Sep 30, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Sep 30, 2025 1:39pm
lexical-playground Ready Ready Preview Comment Sep 30, 2025 1:39pm

@etrepum
etrepum enabled auto-merge September 30, 2025 15:21
@etrepum
etrepum added this pull request to the merge queue Sep 30, 2025
Merged via the queue into meta:main with commit 834cc7e Sep 30, 2025
@etrepum etrepum mentioned this pull request Oct 1, 2025

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — d8601e23 Deployed Sep 30, 2025 by vercel[bot]
Preview – lexical — d8601e23 Deployed Sep 30, 2025 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.

2 participants