|
@@ -13,6 +13,8 @@ import TodoListCheckCommand from '../src/todolistcheckcommand';
|
|
|
import ModelElement from '@ckeditor/ckeditor5-engine/src/model/element';
|
|
import ModelElement from '@ckeditor/ckeditor5-engine/src/model/element';
|
|
|
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
|
|
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
|
|
|
import LinkEditing from '@ckeditor/ckeditor5-link/src/linkediting';
|
|
import LinkEditing from '@ckeditor/ckeditor5-link/src/linkediting';
|
|
|
|
|
+import Enter from '@ckeditor/ckeditor5-enter/src/enter';
|
|
|
|
|
+import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter';
|
|
|
|
|
|
|
|
import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
|
|
import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
|
|
|
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
|
|
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
|
|
@@ -29,7 +31,7 @@ describe( 'TodoListEditing', () => {
|
|
|
beforeEach( () => {
|
|
beforeEach( () => {
|
|
|
return VirtualTestEditor
|
|
return VirtualTestEditor
|
|
|
.create( {
|
|
.create( {
|
|
|
- plugins: [ TodoListEditing, Typing, BoldEditing, BlockQuoteEditing, LinkEditing ]
|
|
|
|
|
|
|
+ plugins: [ TodoListEditing, Typing, BoldEditing, BlockQuoteEditing, LinkEditing, Enter, ShiftEnter ]
|
|
|
} )
|
|
} )
|
|
|
.then( newEditor => {
|
|
.then( newEditor => {
|
|
|
editor = newEditor;
|
|
editor = newEditor;
|
|
@@ -652,6 +654,17 @@ describe( 'TodoListEditing', () => {
|
|
|
'</ul>'
|
|
'</ul>'
|
|
|
);
|
|
);
|
|
|
} );
|
|
} );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should properly handle enter key in list item containing soft-breaks', () => {
|
|
|
|
|
+ setModelData( model, '<listItem listType="todo" listIndent="0">[]Foo<softBreak></softBreak>bar</listItem>' );
|
|
|
|
|
+
|
|
|
|
|
+ editor.execute( 'enter' );
|
|
|
|
|
+
|
|
|
|
|
+ assertEqualMarkup( getModelData( model ),
|
|
|
|
|
+ '<listItem listIndent="0" listType="todo"></listItem>' +
|
|
|
|
|
+ '<listItem listIndent="0" listType="todo">[]Foo<softBreak></softBreak>bar</listItem>'
|
|
|
|
|
+ );
|
|
|
|
|
+ } );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'data pipeline m -> v', () => {
|
|
describe( 'data pipeline m -> v', () => {
|