/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ import { testDataProcessor as test } from '/tests/markdown-gfm/_utils/utils.js'; describe( 'GFMDataProcessor', () => { describe( 'tables', () => { it( 'should process tables', () => { test( '| Heading 1 | Heading 2\n' + '| --- | ---\n' + '| Cell 1 | Cell 2\n' + '| Cell 3 | Cell 4\n', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Heading 1Heading 2
Cell 1Cell 2
Cell 3Cell 4
', // After converting back it will be normalized. '| Heading 1 | Heading 2 |\n' + '| --- | --- |\n' + '| Cell 1 | Cell 2 |\n' + '| Cell 3 | Cell 4 |' ); } ); it( 'should process tables with aligned columns', () => { test( '| Header 1 | Header 2 | Header 3 | Header 4 |\n' + '| :------: | -------: | :------- | -------- |\n' + '| Cell 1 | Cell 2 | Cell 3 | Cell 4 |\n' + '| Cell 5 | Cell 6 | Cell 7 | Cell 8 |', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
', // After converting back it will be normalized. '| Header 1 | Header 2 | Header 3 | Header 4 |\n' + '| :-: | --: | :-- | --- |\n' + '| Cell 1 | Cell 2 | Cell 3 | Cell 4 |\n' + '| Cell 5 | Cell 6 | Cell 7 | Cell 8 |' ); } ); it( 'should process not table without borders', () => { test( 'Header 1 | Header 2\n' + '-------- | --------\n' + 'Cell 1 | Cell 2\n' + 'Cell 3 | Cell 4', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
', // After converting back it will be normalized. '| Header 1 | Header 2 |\n' + '| --- | --- |\n' + '| Cell 1 | Cell 2 |\n' + '| Cell 3 | Cell 4 |' ); } ); it( 'should process formatting inside cells', () => { test( 'Header 1|Header 2|Header 3|Header 4\n' + ':-------|:------:|-------:|--------\n' + '*Cell 1* |**Cell 2** |~~Cell 3~~ |Cell 4', '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
Header 1Header 2Header 3Header 4
' + 'Cell 1' + '' + 'Cell 2' + '' + 'Cell 3' + '' + 'Cell 4' + '
', // After converting back it will be normalized. '| Header 1 | Header 2 | Header 3 | Header 4 |\n' + '| :-- | :-: | --: | --- |\n' + '| _Cell 1_ | **Cell 2** | ~~Cell 3~~ | Cell 4 |' ); } ); } ); } );