From 53481accf13cbb6227d12e98542b0f314b2a586e Mon Sep 17 00:00:00 2001 From: ibrokemypie Date: Sun, 20 Jan 2019 20:00:55 +1100 Subject: Add double underscore syntax for bold markdown (#3733) * Add double underscore syntax for bold markdown see https://github.com/syuilo/misskey/pull/3732 this allows bold text through either **text** or __text__ * Add tests for underscore bold mfm syntax --- test/mfm.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/mfm.ts b/test/mfm.ts index b681ed1d01..bacce017c2 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -177,6 +177,29 @@ describe('MFM', () => { text('bar'), ]); }); + + it('with underscores', () => { + const tokens = analyze('__foo__'); + assert.deepStrictEqual(tokens, [ + tree('bold', [ + text('foo') + ], {}), + ]); + }); + + it('mixed syntax', () => { + const tokens = analyze('**foo__'); + assert.deepStrictEqual(tokens, [ + text('**foo__'), + ]); + }); + + it('mixed syntax', () => { + const tokens = analyze('__foo**'); + assert.deepStrictEqual(tokens, [ + text('__foo**'), + ]); + }); }); it('big', () => { -- cgit v1.2.3-freya