Mentions regex: let localpart be optional

This commit is contained in:
Alex Gleason 2024-06-03 00:47:17 -05:00
parent aa3aca187d
commit 1b9ad86ca2
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

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