From 1b9ad86ca2f9dcc765ea3845c8db197d91a50f7b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 3 Jun 2024 00:47:17 -0500 Subject: [PATCH] Mentions regex: let localpart be optional --- src/actions/compose.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/compose.ts b/src/actions/compose.ts index 99f84298e..5fe6383c2 100644 --- a/src/actions/compose.ts +++ b/src/actions/compose.ts @@ -339,7 +339,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) => return; } - const mentions: string[] | null = status.match(/(?:^|\s)@([a-z\d_-]+(?:@[^@\s]+)?)/gi); + const mentions: string[] | null = status.match(/(?:^|\s)@(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)/gi); if (mentions) { to = to.union(mentions.map(mention => mention.trim().slice(1)));