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

Fix #5703 Infinite loop on hashtag transform #6045

Merged
merged 6 commits into from
May 7, 2024
Merged

Conversation

Sahejkm
Copy link
Contributor

@Sahejkm Sahejkm commented May 7, 2024

Description

  • while transforming the hashtag text entity,
  • if we are skipping a text entity we are not adding the skip length to the next hash tag entity found in the transform logic for the text entity resulting into wrong split and infinite loop
  • Fix to add the previous match length to the next match start and end offset before splitting the text node for the next match

Closes #5703 and #3468 as well

Test plan

Before

Screen.Recording.2024-05-07.at.6.32.34.PM.mov

After

Screen.Recording.2024-05-07.at.6.33.56.PM.mov

Copy link

vercel bot commented May 7, 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 May 7, 2024 4:22pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 4:22pm

@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 7, 2024
Copy link

github-actions bot commented May 7, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 23.75 KB (0%) 475 ms (0%) 267 ms (+14.76% 🔺) 742 ms
packages/lexical-rich-text/dist/LexicalRichText.js 34.32 KB (0%) 687 ms (0%) 484 ms (-10.77% 🔽) 1.2 s
packages/lexical-plain-text/dist/LexicalPlainText.js 34.36 KB (0%) 688 ms (0%) 593 ms (-12.85% 🔽) 1.3 s

zurfyx
zurfyx previously approved these changes May 7, 2024
@zurfyx
Copy link
Member

zurfyx commented May 7, 2024

Wow, I'm surprised this has been in there so long! Can we add a test for this please?

@ivailop7 ivailop7 merged commit 16ff78e into main May 7, 2024
45 checks passed
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
4 participants