diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-04-09 01:54:52 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-09 01:54:52 +0900 |
| commit | 3ef82ccb6206e93327f10146988b7e85a91992f4 (patch) | |
| tree | d8b67984c639c0c22910356c6c55fb7c9ea7bb3c /src/text/parse | |
| parent | Merge pull request #1416 from syuilo/greenkeeper/gulp-pug-4.0.0 (diff) | |
| parent | Fix username/mention regexes (diff) | |
| download | misskey-3ef82ccb6206e93327f10146988b7e85a91992f4.tar.gz misskey-3ef82ccb6206e93327f10146988b7e85a91992f4.tar.bz2 misskey-3ef82ccb6206e93327f10146988b7e85a91992f4.zip | |
Merge pull request #1422 from unarist/fix/username-regex
Fix username/mention regexes
Diffstat (limited to 'src/text/parse')
| -rw-r--r-- | src/text/parse/elements/mention.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/text/parse/elements/mention.ts b/src/text/parse/elements/mention.ts index 4f2997b39f..2ad2788300 100644 --- a/src/text/parse/elements/mention.ts +++ b/src/text/parse/elements/mention.ts @@ -4,7 +4,7 @@ import parseAcct from '../../../acct/parse'; module.exports = text => { - const match = text.match(/^(?:@[a-zA-Z0-9\-]+){1,2}/); + const match = text.match(/^@[a-z0-9_]+(?:@[a-z0-9\.\-]+[a-z0-9])?/i); if (!match) return null; const mention = match[0]; const { username, host } = parseAcct(mention.substr(1)); |