-
Notifications
You must be signed in to change notification settings - Fork 52
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
Don't show numbers as spelling errors #34
base: development
Are you sure you want to change the base?
Conversation
|
stream.next(); | ||
} | ||
|
||
if(CodeMirrorSpellChecker.typo && !CodeMirrorSpellChecker.typo.check(word) && !~customWords.indexOf(word)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you removed the one line that used customWords
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, indeed! Sorry about that. I put it back.
Thanks for making the change. One last thing—can you set up a JSFiddle to demonstrate this change? |
any updates on getting this merged and released? |
I couldn't figure out how to get a JSFiddle working... |
At long last, here is a working CodePen: https://codepen.io/edemaine/pen/QoooOa I had to update a few more things to get this working again:
Hopefully this can now be merged. @WesCossick if you'd rather hand off maintenance, I could try. |
Hey @WesCossick |
This is a fix for #32. I just check whether the word matches
/^[0-9]+$/
and ignore it if so.Along the way, I cleaned up the tokenizer to use regular expressions to detect word characters. This has two advantages:
"very long string".includes
which will check against each character individually. Regular expressions should (I think) build a map to check for matching characters. Also, regular expressions should allow us to read the entire word at once instead of character by character.