Merge branch 'nip05-regex' into 'main'

Mentions regex: let localpart be optional

See merge request soapbox-pub/soapbox!3053
This commit is contained in:
Alex Gleason 2024-06-03 06:08:15 +00:00
commit 566b2f77b1
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)));