Index: _source/plugins/list/plugin.js
===================================================================
--- _source/plugins/list/plugin.js (revision 3808)
+++ _source/plugins/list/plugin.js (working copy)
@@ -11,6 +11,8 @@
{
var listNodeNames = { ol : 1, ul : 1 },
emptyTextRegex = /^[\n\r\t ]*$/;
+ var dtd = CKEDITOR.dtd;
+ var blockLikeTags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent );
CKEDITOR.plugins.list = {
/*
@@ -335,6 +337,7 @@
}
var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode );
+
// 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
.
if ( !groupObj.root.getNext() || groupObj.root.getNext().$.nodeName.toLowerCase() == 'br' )
@@ -342,7 +345,14 @@
if ( newList.listNode.getLast().$.nodeName.toLowerCase() == 'br' )
newList.listNode.getLast().remove();
}
+
+ var parentNode = groupObj.root.getParent();
newList.listNode.replace( groupObj.root );
+
+ // If groupObj.root's parent is a block, we might have removed the filler BR node at the line above.
+ // So put it back if needed. (#3782)
+ if ( parentNode && blockLikeTags[ parentNode.getName() ] )
+ parentNode.appendBogus();
}
function listCommand( name, type )