* Update parser.ts

* Update user.ts

* Update search.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update mfm.ts

* Update parser.ts

* Merge branch 'develop' into 3440-mk2

* Fix typo

* Update parser.ts

* Update mfm.ts

* Update mfm.ts
This commit is contained in:
Acid Chicken (硫酸鶏)
2018-12-17 19:11:38 +09:00
committed by Aya Morisawa
parent 82d721d60b
commit 3bcb344ecb
4 changed files with 19 additions and 3 deletions

View File

@@ -275,7 +275,7 @@ const mfm = P.createLanguage({
mention: r =>
P((input, i) => {
const text = input.substr(i);
const match = text.match(/^@[a-z0-9_]+(?:@[a-z0-9\.\-]+[a-z0-9])?/i);
const match = text.match(/^@\w([\w-]*\w)?(?:@[\w\.\-]+\w)?/);
if (!match) return P.makeFailure(i, 'not a mention');
if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a mention');
return P.makeSuccess(i + match[0].length, match[0]);