Index: _source/plugins/list/plugin.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- _source/plugins/list/plugin.js	(revision 7403)
+++ _source/plugins/list/plugin.js	(revision )
@@ -146,31 +146,39 @@
 					if ( listNodeNames[ item.grandparent.getName() ] )
 						currentListItem = item.element.clone( false, true );
 					else
+						currentListItem = new CKEDITOR.dom.documentFragment( doc );
+
+					// Migrate all children to the new container,
+					// apply the proper text direction.
+					var newBlock,
+						dirLoose = item.grandparent.getDirection( 1 ) != orgDir,
+						enterBr = paragraphMode == CKEDITOR.ENTER_BR;
+
+					for ( var i = 0, child, count = item.contents.length; i < count; i++ )
 					{
-						// Create completely new blocks here.
-						if ( dir || item.element.hasAttributes() || paragraphMode != CKEDITOR.ENTER_BR )
+						child = item.contents[ i ];
+						if ( child.type == CKEDITOR.NODE_ELEMENT && child.isBlockBoundary() )
 						{
-							currentListItem = doc.createElement( paragraphName );
-							item.element.copyAttributes( currentListItem, { type:1, value:1 } );
+							// Apply direction on content blocks.
+							if ( dirLoose && !child.getDirection() )
+								child.setAttribute( 'dir', orgDir );
 
-							// There might be a case where there are no attributes in the element after all
-							// (i.e. when "type" or "value" are the only attributes set). In this case, if enterMode = BR,
-							// the current item should be a fragment.
-							if ( !dir && paragraphMode == CKEDITOR.ENTER_BR && !currentListItem.hasAttributes() )
-								currentListItem = new CKEDITOR.dom.documentFragment( doc );
+							newBlock = null;
 						}
-						else
-							currentListItem = new CKEDITOR.dom.documentFragment( doc );
+						else if ( dirLoose || !enterBr )
+						{
+							// Wrap inline contents with new block, just to remain item direction.
+							if ( !newBlock )
+							{
+								newBlock = doc.createElement( paragraphName );
+								dirLoose && newBlock.setAttribute( 'dir', orgDir );
-					}
+							}
 
-					if ( currentListItem.type == CKEDITOR.NODE_ELEMENT )
-					{
-						if ( item.grandparent.getDirection( 1 ) != orgDir )
-							currentListItem.setAttribute( 'dir', orgDir );
+							newBlock.append( child.clone( 1, 1 ) );
-					}
+						}
 
-					for ( i = 0 ; i < item.contents.length ; i++ )
-						currentListItem.append( item.contents[i].clone( 1, 1 ) );
+						currentListItem.append( newBlock || child.clone( 1, 1 ) );
+					}
 
 					if ( currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT
 						 && currentIndex != listArray.length - 1 )
@@ -187,20 +195,6 @@
 							&& last.getName() in CKEDITOR.dtd.$block ) )
 						{
 							currentListItem.append( doc.createElement( 'br' ) );
-						}
-					}
-
-					if ( currentListItem.type == CKEDITOR.NODE_ELEMENT &&
-							currentListItem.getName() == paragraphName &&
-							currentListItem.$.firstChild )
-					{
-						currentListItem.trim();
-						var firstChild = currentListItem.getFirst();
-						if ( firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.isBlockBoundary() )
-						{
-							var tmp = new CKEDITOR.dom.documentFragment( doc );
-							currentListItem.moveChildren( tmp );
-							currentListItem = tmp;
 						}
 					}
 
