Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 3893)
+++ /CKEditor/trunk/CHANGES.html (revision 3894)
@@ -130,4 +130,5 @@
#3742 : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .
#3671 : Fixed body fixing should be applied to the real type under fake elements.
+ #3836 : Fixed remove list in enterMode=BR will merge sibling text to one line.
Index: /CKEditor/trunk/_source/plugins/list/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/list/plugin.js (revision 3893)
+++ /CKEditor/trunk/_source/plugins/list/plugin.js (revision 3894)
@@ -336,4 +336,13 @@
var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode );
+
+ // Compensate a
before the first node if the previous node of list is a non-blocks.(#3836)
+ var docFragment = newList.listNode, firstNode, previousNode;
+ if ( ( firstNode = docFragment.getFirst() )
+ && !( firstNode.is && firstNode.isBlockBoundary() )
+ && ( previousNode = groupObj.root.getPrevious( true ) )
+ && !( previousNode.is && previousNode.isBlockBoundary( { br : 1 } ) ) )
+ editor.document.createElement( 'br' ).insertBefore( firstNode );
+
// If groupObj.root is the last element in its parent, or its nextSibling is a
, then we should
// not add a
after the final item. So, check for the cases and trim the
.
@@ -343,5 +352,5 @@
newList.listNode.getLast().remove();
}
- newList.listNode.replace( groupObj.root );
+ docFragment.replace( groupObj.root );
}
Index: /CKEditor/trunk/_source/tests/plugins/list/list.html
===================================================================
--- /CKEditor/trunk/_source/tests/plugins/list/list.html (revision 3893)
+++ /CKEditor/trunk/_source/tests/plugins/list/list.html (revision 3894)
@@ -162,4 +162,38 @@
},
+ /**
+ * Test remove list first list item not merging with previous text node.
+ */
+ test_ticket_3836 : function()
+ {
+ prepareEditor( 'test_ticket_3836_editor', null,
+ { enterMode : CKEDITOR.ENTER_BR },
+ function( editor )
+ {
+ this.resume( function()
+ {
+ editor.focus();
+
+ var doc = editor.document,
+ range = new CKEDITOR.dom.range( doc );
+ setRange( range, [ 1, 1, 0, 0 ], [ 1, 1, 1, 1 ] );
+ debugger;
+ var sel = editor.getSelection();
+ sel.selectRanges( [ range ] );
+
+ // Waiting for 'comand state' effected.
+ this.wait( function(){
+ // Remove list.
+ editor.execCommand( 'bulletedlist' );
+ assert.areSame( getTextAreaValue( 'test_ticket_3836_result' ),
+ editor.getData(),
+ 'Remove list result not correct.' );
+ }, 1000 );
+
+ } );
+ }, this );
+ this.wait();
+ },
+
name :document.title
};
@@ -175,4 +209,6 @@
+
+