From 98795aad9abccf8a728bd506704d8175f9cf5d71 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Wed, 30 Jan 2019 15:12:48 +0900 Subject: Merge plainParser into mfm --- test/mfm.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test') diff --git a/test/mfm.ts b/test/mfm.ts index 3497c6258c..9532b7659c 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -1091,6 +1091,38 @@ describe('MFM', () => { }); }); + describe('plainText', () => { + it('text', () => { + const tokens = analyze('foo', true); + assert.deepStrictEqual(tokens, [ + text('foo'), + ]); + }); + + it('emoji', () => { + const tokens = analyze(':foo:', true); + assert.deepStrictEqual(tokens, [ + leaf('emoji', { name: 'foo' }) + ]); + }); + + it('emoji in text', () => { + const tokens = analyze('foo:bar:baz', true); + assert.deepStrictEqual(tokens, [ + text('foo'), + leaf('emoji', { name: 'bar' }), + text('baz'), + ]); + }); + + it('disallow other syntax', () => { + const tokens = analyze('foo **bar** baz', true); + assert.deepStrictEqual(tokens, [ + text('foo **bar** baz'), + ]); + }); + }); + describe('toHtml', () => { it('br', () => { const input = 'foo\nbar\nbaz'; -- cgit v1.2.3-freya