MentionPlugin: use a simpler regex, fix double-@ mentions
Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1530
This commit is contained in:
parent
5449ea3326
commit
f628cd73b0
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ import { $createMentionNode, MentionNode } from '../nodes/mention-node';
|
|||
|
||||
import type { TextNode } from 'lexical';
|
||||
|
||||
const MENTION_REGEX = /(?:^|\s)@(?:[a-z\d_-]+(?:@[^@\s]+)?)/i;
|
||||
const MENTION_REGEX = /(?:^|\s)@[^\s]+/i;
|
||||
|
||||
const MentionPlugin = (): JSX.Element | null => {
|
||||
const [editor] = useLexicalComposerContext();
|
||||
|
|
Loading…
Reference in a new issue