/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
import { testDataProcessor as test } from 'ckeditor5-markdown-gfm/tests/_utils/utils';
describe( 'GFMDataProcessor', () => {
describe( 'headers', () => {
it( 'should process level 1 header #1', () => {
test(
'# Level 1',
'
Level 1
'
);
} );
it( 'should process level 1 header #2', () => {
test(
'Level 1\n' +
'===',
'Level 1
',
// When converting back it will be normalized to # representation.
'# Level 1'
);
} );
it( 'should process level 2 header #1', () => {
test(
'## Level 2',
'Level 2
'
);
} );
it( 'should process level 2 header #2', () => {
test(
'Level 2\n' +
'---',
'Level 2
',
// When converting back it will be normalized to ## representation.
'## Level 2'
);
} );
it( 'should process level 3 header', () => {
test(
'### Level 3',
'Level 3
'
);
} );
it( 'should process level 4 header', () => {
test(
'#### Level 4',
'Level 4
'
);
} );
it( 'should process level 5 header', () => {
test(
'##### Level 5',
'Level 5
'
);
} );
it( 'should process level 6 header', () => {
test(
'###### Level 6',
'Level 6
'
);
} );
it( 'should create header when more spaces before text', () => {
test(
'# 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', () => {
test(
'# header\n' +
'# header',
'header
header
'
);
} );
it( 'should process headers placed next to each other #2', () => {
test(
'# header\n' +
'## header\n' +
'### header',
'header
header
header
'
);
} );
it( 'should process headers followed by a paragraph', () => {
test(
'# header\n\n' +
'paragraph',
'header
paragraph
'
);
} );
} );
} );