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

Hack support for @mentions #7

Closed
wants to merge 2 commits into from
Closed

Conversation

bkeepers
Copy link

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
Copy link
Member

wooorm commented Aug 19, 2016

👍 I’ve got an idea, hold on, I’ll check if it works!

@wooorm
Copy link
Member

wooorm commented Aug 19, 2016

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:

  • maybe it knows about mentions but I doubt it;
  • maybe, similar to how digits work in spell checkers (if there aren’t enough word-characters in a value, values are ignored as well), but I doubt that as well as it’s just one character.

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
Copy link
Author

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? "@" > '@'

Done

@wooorm
Copy link
Member

wooorm commented Aug 20, 2016

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).

@wooorm wooorm closed this Aug 20, 2016
@bkeepers bkeepers deleted the mentions branch October 7, 2016 13:03
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project
Development

Successfully merging this pull request may close these issues.

2 participants