diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2019-01-30 15:12:48 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2019-01-30 15:12:48 +0900 |
| commit | 98795aad9abccf8a728bd506704d8175f9cf5d71 (patch) | |
| tree | 0f6d39f4fcf9540a9914d26cea497e28cead0bab /test | |
| parent | Rename html-to-mfm to fromHtml (diff) | |
| download | sharkey-98795aad9abccf8a728bd506704d8175f9cf5d71.tar.gz sharkey-98795aad9abccf8a728bd506704d8175f9cf5d71.tar.bz2 sharkey-98795aad9abccf8a728bd506704d8175f9cf5d71.zip | |
Merge plainParser into mfm
Diffstat (limited to 'test')
| -rw-r--r-- | test/mfm.ts | 32 |
1 files changed, 32 insertions, 0 deletions
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'; |