Skip to content

Commit 50aea18

Browse files
committed
Merge pull request draft-js-plugins#182 from svrcekmichal/master
fix mention regex if content block starts with @
2 parents 745a458 + 5908f90 commit 50aea18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

draft-js-mention-plugin/src/mentionSearchStrategy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import findWithRegex from 'find-with-regex';
44

5-
const MENTION_REGEX = /\s\@[\w]*/g;
5+
const MENTION_REGEX = /(\s|^)\@[\w]*/g;
66

77
export default (contentBlock: Object, callback: Function) => {
88
findWithRegex(MENTION_REGEX, contentBlock, callback);

0 commit comments

Comments
 (0)