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

Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1530
environments/review-fix-double-v0jtu2/deployments/4049
Alex Gleason 2023-09-25 13:30:52 -05:00
rodzic 5449ea3326
commit f628cd73b0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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