diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-22 05:04:45 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-22 05:04:45 +0900 |
| commit | 2b4d63b1bbbe2e72f06e1763e21f85b6662de8df (patch) | |
| tree | 69287a2ed359d9ea7d64ba55d106b7cc80056faa /test | |
| parent | [MFM] Improve URL parsing (diff) | |
| download | sharkey-2b4d63b1bbbe2e72f06e1763e21f85b6662de8df.tar.gz sharkey-2b4d63b1bbbe2e72f06e1763e21f85b6662de8df.tar.bz2 sharkey-2b4d63b1bbbe2e72f06e1763e21f85b6662de8df.zip | |
Add some tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/mfm.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/mfm.ts b/test/mfm.ts index 8447e798e2..a40f769f80 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -420,6 +420,26 @@ describe('Text', () => { text('after'), ], tokens); }); + + it('with brackets', () => { + const tokens = analyze('[foo](https://example.com/foo(bar))'); + assert.deepEqual([ + nodeWithChildren('link', [ + text('foo') + ], { url: 'https://example.com/foo(bar)', silent: false }) + ], tokens); + }); + + it('with parent brackets', () => { + const tokens = analyze('([foo](https://example.com/foo(bar)))'); + assert.deepEqual([ + text('('), + nodeWithChildren('link', [ + text('foo') + ], { url: 'https://example.com/foo(bar)', silent: false }), + text(')') + ], tokens); + }); }); it('emoji', () => { |