MentionPlugin: use a simpler regex, fix double-@ mentions

Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1530
This commit is contained in:
Alex Gleason 2023-09-25 13:30:52 -05:00
parent 5449ea3326
commit f628cd73b0
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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();