summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webapp/components/suggestion/at_mention_provider.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/webapp/components/suggestion/at_mention_provider.jsx b/webapp/components/suggestion/at_mention_provider.jsx
index d4f441f98..d1a03deb5 100644
--- a/webapp/components/suggestion/at_mention_provider.jsx
+++ b/webapp/components/suggestion/at_mention_provider.jsx
@@ -112,7 +112,7 @@ export default class AtMentionProvider {
handlePretextChanged(suggestionId, pretext) {
clearTimeout(this.timeoutId);
- const captured = (/@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase());
+ const captured = (/(?:^|\W)@([a-z0-9\-\._]*)$/i).exec(pretext.toLowerCase());
if (captured) {
const prefix = captured[1];
@@ -146,7 +146,7 @@ export default class AtMentionProvider {
AppDispatcher.handleServerAction({
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
id: suggestionId,
- matchedPretext: captured[0],
+ matchedPretext: `@${captured[1]}`,
terms: mentions,
items: users,
component: AtMentionSuggestion