From 31aa00856647433c3d4d2f2eb5840d2322e9ffa0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Nov 2020 23:41:21 +0900 Subject: Improve MFM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MFMの構文を調整 + 新しいアニメーション追加 Resolve #6816 --- test/mfm.ts | 167 ------------------------------------------------------------ 1 file changed, 167 deletions(-) (limited to 'test') diff --git a/test/mfm.ts b/test/mfm.ts index 69c340bc0b..6244263a30 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -227,16 +227,6 @@ describe('MFM', () => { }); }); - it('big', () => { - const tokens = parse('***Strawberry*** Pasta'); - assert.deepStrictEqual(tokens, [ - tree('big', [ - text('Strawberry') - ], {}), - text(' Pasta'), - ]); - }); - it('small', () => { const tokens = parse('smaller'); assert.deepStrictEqual(tokens, [ @@ -246,133 +236,6 @@ describe('MFM', () => { ]); }); - it('flip', () => { - const tokens = parse('foo'); - assert.deepStrictEqual(tokens, [ - tree('flip', [ - text('foo') - ], {}), - ]); - }); - - describe('spin', () => { - it('text', () => { - const tokens = parse('foo'); - assert.deepStrictEqual(tokens, [ - tree('spin', [ - text('foo') - ], { - attr: null - }), - ]); - }); - - it('emoji', () => { - const tokens = parse(':foo:'); - assert.deepStrictEqual(tokens, [ - tree('spin', [ - leaf('emoji', { name: 'foo' }) - ], { - attr: null - }), - ]); - }); - - it('with attr', () => { - const tokens = parse(':foo:'); - assert.deepStrictEqual(tokens, [ - tree('spin', [ - leaf('emoji', { name: 'foo' }) - ], { - attr: 'left' - }), - ]); - }); -/* - it('multi', () => { - const tokens = parse(':foo::foo:'); - assert.deepStrictEqual(tokens, [ - tree('spin', [ - leaf('emoji', { name: 'foo' }) - ], { - attr: null - }), - tree('spin', [ - leaf('emoji', { name: 'foo' }) - ], { - attr: null - }), - ]); - }); - - it('nested', () => { - const tokens = parse(':foo:'); - assert.deepStrictEqual(tokens, [ - tree('spin', [ - tree('spin', [ - leaf('emoji', { name: 'foo' }) - ], { - attr: null - }), - ], { - attr: null - }), - ]); - }); -*/ - }); - - it('jump', () => { - const tokens = parse(':foo:'); - assert.deepStrictEqual(tokens, [ - tree('jump', [ - leaf('emoji', { name: 'foo' }) - ], {}), - ]); - }); - - describe('motion', () => { - it('by triple brackets', () => { - const tokens = parse('(((foo)))'); - assert.deepStrictEqual(tokens, [ - tree('motion', [ - text('foo') - ], {}), - ]); - }); - - it('by triple brackets (with other texts)', () => { - const tokens = parse('bar(((foo)))bar'); - assert.deepStrictEqual(tokens, [ - text('bar'), - tree('motion', [ - text('foo') - ], {}), - text('bar'), - ]); - }); - - it('by tag', () => { - const tokens = parse('foo'); - assert.deepStrictEqual(tokens, [ - tree('motion', [ - text('foo') - ], {}), - ]); - }); - - it('by tag (with other texts)', () => { - const tokens = parse('barfoobar'); - assert.deepStrictEqual(tokens, [ - text('bar'), - tree('motion', [ - text('foo') - ], {}), - text('bar'), - ]); - }); - }); - describe('mention', () => { it('local', () => { const tokens = parse('@himawari foo'); @@ -1310,30 +1173,6 @@ describe('MFM', () => { it('小さい字', () => { assert.deepStrictEqual(toString(parse('小さい字')), '小さい字'); }); - it('モーション', () => { - assert.deepStrictEqual(toString(parse('モーション')), 'モーション'); - }); - it('モーション2', () => { - assert.deepStrictEqual(toString(parse('(((モーション)))')), 'モーション'); - }); - it('ビッグ+', () => { - assert.deepStrictEqual(toString(parse('*** ビッグ+ ***')), '*** ビッグ+ ***'); - }); - it('回転', () => { - assert.deepStrictEqual(toString(parse('回転')), '回転'); - }); - it('右回転', () => { - assert.deepStrictEqual(toString(parse('右回転')), '右回転'); - }); - it('左回転', () => { - assert.deepStrictEqual(toString(parse('左回転')), '左回転'); - }); - it('往復回転', () => { - assert.deepStrictEqual(toString(parse('往復回転')), '往復回転'); - }); - it('ジャンプ', () => { - assert.deepStrictEqual(toString(parse('ジャンプ')), 'ジャンプ'); - }); it('コードブロック', () => { assert.deepStrictEqual(toString(parse('```\nコードブロック\n```')), '```\nコードブロック\n```'); }); @@ -1352,12 +1191,6 @@ describe('MFM', () => { it('詳細なしリンク', () => { assert.deepStrictEqual(toString(parse('?[詳細なしリンク](http://example.com)')), '?[詳細なしリンク](http://example.com)'); }); - it('【タイトル】', () => { - assert.deepStrictEqual(toString(parse('【タイトル】')), '[タイトル]'); - }); - it('[タイトル]', () => { - assert.deepStrictEqual(toString(parse('[タイトル]')), '[タイトル]'); - }); it('インライン数式', () => { assert.deepStrictEqual(toString(parse('\\(インライン数式\\)')), '\\(インライン数式\\)'); }); -- cgit v1.2.3-freya