diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 50e98189..97018421 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -1828,4 +1828,61 @@ test('Test italic/bold/strikethrough markdown to keep consistency', () => { testString = '~This~is~strikethrough~test~~~~'; resultString = 'This~is~strikethrough~test~~~'; expect(parser.replace(testString)).toBe(resultString); -}); \ No newline at end of file +}); + + +describe('multi-level blockquote', () => { + test('test max level of blockquote (3)', () => { + const quoteTestStartString = '>>>>> Hello world'; + const quoteTestReplacedString = '
>> Hello world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + test('multi-level blockquote with single space', () => { + const quoteTestStartString = '> > > Hello world'; + const quoteTestReplacedString = '
Hello world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + test('multi-level blockquote with multiple spaces', () => { + const quoteTestStartString = '> > > Hello world'; + const quoteTestReplacedString = '
Hello world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + + test('multi-level blockquote with mixed spaces', () => { + const quoteTestStartString = '> > > Hello world'; + const quoteTestReplacedString = '
Hello world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + + test('multi-level blockquote with diffrent syntax', () => { + const quoteTestStartString = '> > _Hello_ *world*'; + const quoteTestReplacedString = '
Hello world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + + test('multi-level blockquote with nested heading', () => { + const quoteTestStartString = '> > # Hello world'; + const quoteTestReplacedString = '

Hello world

'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + + test('multiline multi-level blockquote', () => { + const quoteTestStartString = '> > Hello my\n> > beautiful\n> > world\n'; + const quoteTestReplacedString = '
Hello my
beautiful
world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); + + test('multiline blockquote with diffrent levels', () => { + const quoteTestStartString = '> > > Hello my\n> > beautiful\n> world\n'; + const quoteTestReplacedString = '
Hello my
beautiful
world
'; + + expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); + }); +});