mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Update parser.ts
This commit is contained in:
parent
1001e6e5f4
commit
3597297b18
1 changed files with 1 additions and 1 deletions
|
@ -211,7 +211,7 @@ const mfm = P.createLanguage({
|
||||||
hashtag = hashtag.substr(0, getTrailingPosition(hashtag));
|
hashtag = hashtag.substr(0, getTrailingPosition(hashtag));
|
||||||
if (hashtag.match(/^[0-9]+$/)) return P.makeFailure(i, 'not a hashtag');
|
if (hashtag.match(/^[0-9]+$/)) return P.makeFailure(i, 'not a hashtag');
|
||||||
if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a hashtag');
|
if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a hashtag');
|
||||||
if (hashtag.length > 30) return P.makeFailure(i, 'not a hashtag');
|
if (hashtag.length > 50) return P.makeFailure(i, 'not a hashtag');
|
||||||
return P.makeSuccess(i + ('#' + hashtag).length, makeNode('hashtag', { hashtag: hashtag }));
|
return P.makeSuccess(i + ('#' + hashtag).length, makeNode('hashtag', { hashtag: hashtag }));
|
||||||
}),
|
}),
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
Loading…
Reference in a new issue