codemirror-spell-checker icon indicating copy to clipboard operation
codemirror-spell-checker copied to clipboard

Don't show numbers as spelling errors

Open edemaine opened this issue 8 years ago • 6 comments

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:

  • Simpler code.
  • More efficient. Old code was checking "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.

edemaine avatar Jan 17 '17 17:01 edemaine

~~By the way, the checks report 'customWords' is assigned a value but never use but this was true in the original code. I assume you were in the middle of implementing #16.~~

edemaine avatar Jan 17 '17 17:01 edemaine

Thanks for making the change. One last thing—can you set up a JSFiddle to demonstrate this change?

WesCossick avatar Jan 24 '17 23:01 WesCossick

any updates on getting this merged and released?

alexrothenberg avatar May 01 '17 20:05 alexrothenberg

I couldn't figure out how to get a JSFiddle working...

edemaine avatar May 01 '17 21:05 edemaine

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:

  • The existing customWords code was broken in the case that customWords weren't specified.
  • gulp needed an explicit (older) version to work.
  • Some small lint updates.

Hopefully this can now be merged. @WesCossick if you'd rather hand off maintenance, I could try.

edemaine avatar Mar 25 '19 18:03 edemaine

Hey @WesCossick Can you please look into this? Thank you!

kaleemullah avatar Mar 04 '20 16:03 kaleemullah