Use a better regex for mentions
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
02d1c5dcff
commit
fff4077c73
1 changed files with 2 additions and 1 deletions
|
@ -357,7 +357,8 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
|
|||
return;
|
||||
}
|
||||
|
||||
const mentions: string[] | null = status.match(/(?:^|\s)@([a-z\d_-]+(?:@[^@\s]+)?)/gi);
|
||||
// https://stackoverflow.com/a/30007882 for domain regex
|
||||
const mentions: string[] | null = status.match(/(?:^|\s)@([a-z\d_-]+(?:@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]+)?)/gi);
|
||||
|
||||
if (mentions) {
|
||||
to = to.union(mentions.map(mention => mention.trim().slice(1)));
|
||||
|
|
Loading…
Reference in a new issue