diff --git a/src/mfm/language.ts b/src/mfm/language.ts index fc191d0423..207400d6d6 100644 --- a/src/mfm/language.ts +++ b/src/mfm/language.ts @@ -141,7 +141,7 @@ export const mfmLanguage = P.createLanguage({ }, hashtag: () => P((input, i) => { const text = input.substr(i); - const match = text.match(/^#([^\s\.,!\?'"#:\/\[\]]+)/i); + const match = text.match(/^#([^\s\.,!\?'"#:\/\[\]【】]+)/i); if (!match) return P.makeFailure(i, 'not a hashtag'); let hashtag = match[1]; hashtag = removeOrphanedBrackets(hashtag); diff --git a/test/mfm.ts b/test/mfm.ts index 8098102e92..89b414eba8 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -562,6 +562,14 @@ describe('MFM', () => { ]); }); + it('ignore 】', () => { + const tokens = parse('#foo】'); + assert.deepStrictEqual(tokens, [ + leaf('hashtag', { hashtag: 'foo' }), + text('】'), + ]); + }); + it('allow including number', () => { const tokens = parse('#foo123'); assert.deepStrictEqual(tokens, [