hashtag can not include XML tags (#74)

This commit is contained in:
Johann150 2021-08-28 12:03:01 +02:00 committed by GitHub
parent fcd17d6eeb
commit e6af8bc92a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -355,7 +355,7 @@ hashtagBracketPair
/ "「" hashtagContent* "」"
hashtagChar
= ![  \t.,!?'"#:\/\[\]【】()「」] CHAR
= ![  \t.,!?'"#:\/\[\]【】()「」<>] CHAR
// inline: URL

View file

@ -716,6 +716,12 @@ hoge`;
assert.deepStrictEqual(mfm.parse(input), output);
});
it('ignore angle bracket', () => {
const input = '#foo<bar>';
const output = [HASHTAG('foo'), TEXT('<bar>')];
assert.deepStrictEqual(mfm.parse(input), output);
});
it('allow including number', () => {
const input = '#foo123';
const output = [HASHTAG('foo123')];