Skip to content
Snippets Groups Projects
Commit 1a8632e8 authored by MeiMei's avatar MeiMei Committed by syuilo
Browse files

Fix: Keycap Number Sign が表示できない (#5431)

* Fix: Keycap Number Sign が表示できない

* add U+20E3
parent c1c95503
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,7 @@ export const mfmLanguage = P.createLanguage({
if (!match) return P.makeFailure(i, 'not a hashtag');
let hashtag = match[1];
hashtag = removeOrphanedBrackets(hashtag);
if (hashtag.match(/^(\u20e3|\ufe0f)/)) 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 (hashtag.length > 50) return P.makeFailure(i, 'not a hashtag');
......
......@@ -639,6 +639,20 @@ describe('MFM', () => {
text('/bar'),
]);
});
it('ignore Keycap Number Sign (U+0023 + U+20E3)', () => {
const tokens = parse('#⃣');
assert.deepStrictEqual(tokens, [
leaf('emoji', { emoji: '#⃣' })
]);
});
it('ignore Keycap Number Sign (U+0023 + U+FE0F + U+20E3)', () => {
const tokens = parse('#️⃣');
assert.deepStrictEqual(tokens, [
leaf('emoji', { emoji: '#️⃣' })
]);
});
});
describe('quote', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment