retextjs / retext-spell

plugin to check spelling
https://unifiedjs.com
MIT License
73 stars 16 forks source link

Hack support for @mentions #7

Closed bkeepers closed 8 years ago

bkeepers commented 8 years ago

This is a hack to ignore @mentions when checking spelling.

I don't really expect this to be merged, but wanted to start a conversation about how to extend the spellcheck module.

@wooorm any ideas?

wooorm commented 8 years ago

:+1: I’ve got an idea, hold on, I’ll check if it works!

wooorm commented 8 years ago

Nope. That doesn’t work. I thought if I used remark-github, which detects those mentions and wraps them in a link would hide them from retext, but retext is “smart” enough to still see them...

I wonder why my macOS spell checker ignores them though:

Using at-mentions is pretty common, so I think I’m actually ok with adding support for them, through an option, like this. Could you fix the linting issue? "@" > '@'

bkeepers commented 8 years ago

Using at-mentions is pretty common, so I think I’m actually ok with adding support for them, through an option, like this.

:cool:

Could you fix the linting issue? "@" > '@'

Done

wooorm commented 8 years ago

I came up with a better solution, so your style fix was unfortunately in vain! 😬

The thing I came up with, which could also work for other non-natural-language things (and I thought of this before regarding dates, not sure why I forgot it again), is to classify those differently. That‘s the SourceNode.

There’s a new plugin which does exactly that: retext-syntax-mentions. You can use it by adding .use(require(syntaxMentions')) somewhere before .use(spell).