-
Notifications
You must be signed in to change notification settings - Fork 40
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
The regex that detects mentions is assuming English (and similar) languages #121
Comments
Understood, but unfortunately I had to make concessions as to how the mentions regex matcher works... For example, I don't want it to trigger the mentions autocomplete dialog when you simply type an email address (e.g. [email protected]) Unfortunately, I can't think of a solution around this. Do other services provide mentions in this manner? I am attempting to try with GitHub right now, but it also seems to want a whitespace character before the mention. |
Perhaps detect and linkify mentions anywhere they occur but only trigger the autocomplete when after a whitespace.
Github seems to be quite clever about this and only linkifies mentions which are not proceeded by [0-9a-zA-Z] |
Right... and just like GitHub (not that I'm comparing or anything), we also have separate logic for linkifying mentions vs. spawning the autocomplete dialog. They each have their own regex, although they are for all intents and purposes identical when it comes to matching a mention. It's because of unicode characters that we couldn't simply check for the word boundary meta character |
Anything is better than nothing :) |
The regex that detects "mentions" is assuming that an
@
character is only the start of a mention if it follows a whitespace character (or a very limited number of other characters).This assumption isn't true in other languages where a preposition may be expressed by prefixing the subject word.
e.g. In English we say "... that @xyz said..."
In Hebrew this is written as: "ש-@xyz אמר", or even as "ש@xyz אמר" without the hyphen.
I would suggest adding an allowance for hyphens at minimum.
edit: I see that Github detects all the mentions here... (sorry @xyz for awakening you from your slumber...)
The text was updated successfully, but these errors were encountered: