/** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ import { testDataProcessor } from '../_utils/utils'; describe( 'GFMDataProcessor', () => { describe( 'headers', () => { it( 'should process level 1 header #1', () => { testDataProcessor( '# Level 1', '

Level 1

' ); } ); it( 'should process level 1 header #2', () => { testDataProcessor( 'Level 1\n' + '===', '

Level 1

', // When converting back it will be normalized to # representation. '# Level 1' ); } ); it( 'should process level 2 header #1', () => { testDataProcessor( '## Level 2', '

Level 2

' ); } ); it( 'should process level 2 header #2', () => { testDataProcessor( 'Level 2\n' + '---', '

Level 2

', // When converting back it will be normalized to ## representation. '## Level 2' ); } ); it( 'should process level 3 header', () => { testDataProcessor( '### Level 3', '

Level 3

' ); } ); it( 'should process level 4 header', () => { testDataProcessor( '#### Level 4', '

Level 4

' ); } ); it( 'should process level 5 header', () => { testDataProcessor( '##### Level 5', '
Level 5
' ); } ); it( 'should process level 6 header', () => { testDataProcessor( '###### Level 6', '
Level 6
' ); } ); it( 'should create header when more spaces before text', () => { testDataProcessor( '# Level 1', '

Level 1

', // When converting back it will be normalized to # Level 1. '# Level 1' ); } ); it( 'should process headers placed next to each other #1', () => { testDataProcessor( '# header\n' + '# header', '

header

header

', '# header\n' + '\n' + '# header' ); } ); it( 'should process headers placed next to each other #2', () => { testDataProcessor( '# header\n' + '## header\n' + '### header', '

header

header

header

', '# header\n' + '\n' + '## header\n' + '\n' + '### header' ); } ); it( 'should process headers followed by a paragraph', () => { testDataProcessor( '# header\n\n' + 'paragraph', '

header

paragraph

' ); } ); } ); } );