/** * @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( 'blockquotes', () => { it( 'should process single blockquotes', () => { testDataProcessor( '> foo bar', // GitHub is rendering as: // //
//

foo bar

//
'

foo bar

' ); } ); it( 'should process nested blockquotes', () => { testDataProcessor( '> foo\n' + '> \n' + '> > bar\n' + '> \n' + '> foo', // GitHub is rendering as: //
//

foo

// //
//

bar

//
// //

foo

//
'
' + '

foo

' + '
' + '

bar

' + '
' + '

foo

' + '
' ); } ); it( 'should process list within a blockquote', () => { testDataProcessor( '> A list within a blockquote:\n' + '> \n' + '> * asterisk 1\n' + '> * asterisk 2\n' + '> * asterisk 3', // GitHub is rendering as: //
//

A list within a blockquote:

// // //
'
' + '

A list within a blockquote:

' + '' + '
' ); } ); it( 'should process blockquotes with code inside with ```', () => { testDataProcessor( '> Example 1:\n' + '> \n' + '> ```\n' + '> code 1\n' + '> ```\n' + '> \n' + '> Example 2:\n' + '> \n' + '> ```\n' + '> code 2\n' + '> ```', // GitHub is rendering as: //
//

Example 1:

// //
code 1
				// 
// //

Example 2:

// //
code 2
				// 
//
'
' + '

Example 1:

' + '
' +
						'' +
							'code 1' +
						'' +
					'
' + '

Example 2:

' + '
' +
						'' +
							'code 2' +
						'' +
					'
' + '
' ); } ); it( 'should process blockquotes with code inside with tabs', () => { testDataProcessor( '> Example 1:\n' + '>\n' + '> code 1\n' + '>\n' + '> Example 2:\n' + '>\n' + '> code 2\n', // GitHub is rendering as: //
//

Example 1:

// //
code 1
				// 
// //

Example 2:

// //
code 2
				// 
//
'
' + '

Example 1:

' + '
' +
						'' +
							'code 1' +
						'' +
					'
' + '

Example 2:

' + '
' +
						'' +
							'code 2' +
						'' +
					'
' + '
', // When converting back to data, DataProcessor will normalize tabs to ```. '> Example 1:\n' + '> \n' + '> ```\n' + '> code 1\n' + '> ```\n' + '> \n' + '> Example 2:\n' + '> \n' + '> ```\n' + '> code 2\n' + '> ```' ); } ); } ); } );