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: disable spellcheck for code format #4927

Merged
merged 6 commits into from
Aug 30, 2023
Merged

Conversation

zignis
Copy link
Contributor

@zignis zignis commented Aug 28, 2023

Disables spellcheck for text nodes with code format.

@vercel
Copy link

vercel bot commented Aug 28, 2023

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 Aug 29, 2023 4:27am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2023 4:27am

@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 Aug 28, 2023
Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Should we also add a condition on LexicalCodeNode to handle code blocks?

You'll also need to update the E2E tests to reflect this new property

packages/lexical/src/nodes/LexicalTextNode.ts Outdated Show resolved Hide resolved
Co-authored-by: Gerard Rovira <zurfyx@users.noreply.github.com>
@zignis
Copy link
Contributor Author

zignis commented Aug 28, 2023

Thanks! Should we also add a condition on LexicalCodeNode to handle code blocks?

You'll also need to update the E2E tests to reflect this new property

I think LexicalCodeNode already handles this:

element.setAttribute('spellcheck', 'false');

@zurfyx
Copy link
Member

zurfyx commented Aug 30, 2023

Thank you! I'll merge this. Any chance you can push another PR with the code block (CodeBlockNode)?

Screenshot 2023-08-30 at 5 55 22 PM

The first case should also be marked as non spellcheckable but it won't fall under the TextNode condition you added

@zurfyx zurfyx merged commit 1fcb310 into facebook:main Aug 30, 2023
@zignis
Copy link
Contributor Author

zignis commented Aug 31, 2023

Thank you! I'll merge this. Any chance you can push another PR with the code block (CodeBlockNode)?

Screenshot 2023-08-30 at 5 55 22 PM

The first case should also be marked as non spellcheckable but it won't fall under the TextNode condition you added

I'll look into it

@zignis zignis deleted the code-spellcheck branch August 31, 2023 01:53
@zignis
Copy link
Contributor Author

zignis commented Aug 31, 2023

@zurfyx the code element already has spellcheck=false:

Snapshot_2023-08-31_19-19-15

Am i missing something here?

@acywatson acywatson mentioned this pull request Sep 7, 2023
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.

3 participants