|
|
@@ -4,6 +4,8 @@
|
|
|
*/
|
|
|
|
|
|
import { testDataProcessor } from '../_utils/utils';
|
|
|
+import MarkdownDataProcessor from '../../src/gfmdataprocessor';
|
|
|
+import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
|
|
|
|
|
|
describe( 'GFMDataProcessor', () => {
|
|
|
describe( 'lists', () => {
|
|
|
@@ -352,5 +354,28 @@ describe( 'GFMDataProcessor', () => {
|
|
|
'<li><input checked="" disabled="" type="checkbox"></input>Item 2</li>' +
|
|
|
'</ul>' );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should process the HTML produced by the todo list feature', () => {
|
|
|
+ const htmlDataProcessor = new HtmlDataProcessor();
|
|
|
+ const mdDataProcessor = new MarkdownDataProcessor();
|
|
|
+
|
|
|
+ const viewFragment = htmlDataProcessor.toView(
|
|
|
+ '<ul class="todo-list">' +
|
|
|
+ '<li><label class="todo-list__label">' +
|
|
|
+ '<input type="checkbox" disabled="disabled">' +
|
|
|
+ '<span class="todo-list__label__description">Item 1</span>' +
|
|
|
+ '</label></li>' +
|
|
|
+ '<li><label class="todo-list__label">' +
|
|
|
+ '<input type="checkbox" disabled="disabled" checked="checked">' +
|
|
|
+ '<span class="todo-list__label__description">Item 2</span>' +
|
|
|
+ '</label></li>' +
|
|
|
+ '</ul>'
|
|
|
+ );
|
|
|
+
|
|
|
+ expect( mdDataProcessor.toData( viewFragment ) ).to.equal(
|
|
|
+ '* [ ] List 1\n' +
|
|
|
+ '* [x] Item 2'
|
|
|
+ );
|
|
|
+ } );
|
|
|
} );
|
|
|
} );
|