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

Revisit formatText node selection #2524

Merged
merged 5 commits into from
Jun 27, 2022
Merged

Revisit formatText node selection #2524

merged 5 commits into from
Jun 27, 2022

Conversation

zurfyx
Copy link
Member

@zurfyx zurfyx commented Jun 27, 2022

The current logic is based on hardcoded conditions that rely on either the first node being a TextNode or the second. This breaks when the immediate sibling is not a TextNode. Given that formatText has to look exclusively at text nodes we can improve the logic by looking exclusively at the sorted text nodes.

Screen.Recording.2022-06-27.at.12.22.30.pm.mov

Closes #2523

@vercel
Copy link

vercel bot commented Jun 27, 2022

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

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jun 27, 2022 at 11:23AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 27, 2022 at 11:23AM (UTC)

@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 Jun 27, 2022
@zurfyx zurfyx merged commit 87f478c into main Jun 27, 2022
@trueadm trueadm deleted the fix-edge-format branch December 18, 2022 00:54
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.

formatText crashes when image is first node
3 participants