tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Regular emoji throwing spellcheck warnings #41

Closed ryanblock closed 5 years ago

ryanblock commented 5 years ago

This library is great!

Noticed that regular emoji are throwing warnings. For example:

./src/shared/en/aws/guides-custom-dns.md
     63:9-63:10  warning  `️` is misspelt  retext-spell  retext-spell
      80:4-80:5  warning  `️` is misspelt  retext-spell  retext-spell
  107:42-107:43  warning  `️` is misspelt  retext-spell  retext-spell

The lines in question:

63: > 🤷🏽‍♀️ DNS propagation can take time: have patience! 80: > ⛳️ Tip: These instructions will serve your app's production environment... 107: ...grab a cup of coffee or tea ☕️ – it can take a few minutes while...

May take a crack at a fix (would first try implementing remark-emoji, would that kind of thing be accepted as a PR?

tbroadley commented 5 years ago

Good find, thanks! I'd absolutely take a PR to fix this.

ryanblock commented 5 years ago

This turned out to be a bit more subtle than I'd expected / hoped. There's something somewhere triggering failures on standard unicode emoji variation selector char (invisible, UTF-8 hex: 0xEF 0xB8 0x8F [efb88f]).

Haven't yet had the time to track it down beyond that, but for reference I've attached a single line array containing the char in question, which does successfully suppress the erroneous warnings: dictionary.js.zip

P.S. I super love this project. Really nice work. It's now a mandatory build step for all our docs sites! 💕

j-f1 commented 5 years ago

Looks like you’ve got Variation Selector 16, which coerces characters into emoji.

tbroadley commented 5 years ago

43 should fix this issue by filtering out Variation Selectors 15 and 16 before spellchecking. Is there any chance you'd be able to test the fix @ryanblock?

ryanblock commented 5 years ago

Kudos for getting to this! It has been on my to-do list. 🌈

I'll go give it a peek!

ryanblock commented 5 years ago

Issue no longer replicates locally! (Also tested with skin tone, family, and some other variations.) Woo!

tbroadley commented 5 years ago

Great! I just released v4.0.1, which contains the fix.