Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical][auto-link] Fix auto link node escapes on second "." #6146

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

MaxPlav
Copy link
Contributor

@MaxPlav MaxPlav commented May 20, 2024

Description

The period in the separators list PUNCTUATION_OR_SPACE leads to an auto-link creation prematurely before the user completes typing. Removing the "." from the list.
Inspired by #5275 which was reverted because of Regexp changes.

Closes: #5254 #3546

Test plan

  1. Open https://playground.lexical.dev/
  2. Type "https://www.foo.com"
  3. See that the link is created for the full URL.

Before

Screen.Recording.2024-05-20.at.12.13.38.mov

After

Screen.Recording.2024-05-20.at.12.14.09.mov

Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 7:09pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 7:09pm

@facebook-github-bot facebook-github-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 May 20, 2024
Copy link

github-actions bot commented May 20, 2024

size-limit report 📦

Path Size
lexical - cjs 28.31 KB (0%)
lexical - esm 28.13 KB (0%)
@lexical/rich-text - cjs 36.77 KB (0%)
@lexical/rich-text - esm 28.09 KB (0%)
@lexical/plain-text - cjs 35.36 KB (0%)
@lexical/plain-text - esm 25.33 KB (0%)
@lexical/react - cjs 38.51 KB (0%)
@lexical/react - esm 29.14 KB (0%)

@MaxPlav MaxPlav marked this pull request as ready for review May 20, 2024 17:20
@StyleT
Copy link
Contributor

StyleT commented May 20, 2024

I think it's not that easy :P See how it fails now:

Screen.Recording.2024-05-20.at.4.34.33.PM.mov

@MaxPlav
Copy link
Contributor Author

MaxPlav commented May 20, 2024

I think it's not that easy :P See how it fails now:

Screen.Recording.2024-05-20.at.4.34.33.PM.mov

updated the regexp with a negative lookbehind to exclude special characters at the end

@StyleT
Copy link
Contributor

StyleT commented May 21, 2024

Hi! So now links doesn't work correctly when you have a dot at the end of the sentence:

Screen.Recording.2024-05-21.at.1.01.03.PM.mov

@StyleT StyleT added the contribution-week Issues that are good to be picked up for the contribution week label May 23, 2024
@MaxPlav MaxPlav marked this pull request as draft June 5, 2024 19:56
@MaxPlav
Copy link
Contributor Author

MaxPlav commented Jun 11, 2024

Hi! So now links doesn't work correctly when you have a dot at the end of the sentence:

Screen.Recording.2024-05-21.at.1.01.03.PM.mov

thanks for checking that, should be fixed now

@StyleT StyleT added the extended-tests Run extended e2e tests on a PR label Jun 11, 2024
@Sahejkm Sahejkm added this pull request to the merge queue Jun 12, 2024
Merged via the queue into facebook:main with commit 1f2471f Jun 12, 2024
66 checks passed
AlessioGr added a commit to payloadcms/payload that referenced this pull request Jul 2, 2024
paulpopus pushed a commit to payloadcms/payload that referenced this pull request Jul 24, 2024
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. contribution-week Issues that are good to be picked up for the contribution week extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants