Index: /FCKeditor/branches/features/custom_list_command/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/branches/features/custom_list_command/editor/_source/classes/fckdomrange.js	(revision 796)
+++ /FCKeditor/branches/features/custom_list_command/editor/_source/classes/fckdomrange.js	(revision 797)
@@ -847,5 +847,5 @@
 			if ( currentStart == null && currentEnd.nodeType == 3 )
 			{
-				// Ignore normal whitespaces (i.e. not including &nbsp; or other unicode whitespaces) after a block node.
+				// Ignore normal whitespaces (i.e. not including &nbsp; or other unicode whitespaces) after a block node or br.
 				if ( currentEnd.nodeValue.search( /^[\r\n\t ]+$/ ) == 0 )
 				{
@@ -854,5 +854,6 @@
 					{
 						var prevTag = String( prevNode.tagName ).toLowerCase() ;
-						if ( ! ( FCKListsLib.BlockElements[prevTag] || FCKListsLib.NonEmptyBlockElements[prevTag] ) )
+						if ( ! ( FCKListsLib.BlockElements[prevTag] || FCKListsLib.NonEmptyBlockElements[prevTag] ||
+						      prevTag == 'br' ) )
 							currentStart = currentEnd ;
 					}
Index: /FCKeditor/branches/features/custom_list_command/editor/_source/commandclasses/fcklistcommands.js
===================================================================
--- /FCKeditor/branches/features/custom_list_command/editor/_source/commandclasses/fcklistcommands.js	(revision 796)
+++ /FCKeditor/branches/features/custom_list_command/editor/_source/commandclasses/fcklistcommands.js	(revision 797)
@@ -33,6 +33,23 @@
 		if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || ! FCK.EditorWindow )
 			return FCK_TRISTATE_DISABLED ;
-		var terminals = FCKSelection.GetSelectionTerminals() ;
-		var listBlock = this._GetNearestListParent( terminals.startNode, terminals.endNode ) ;
+
+		var terminals = null ;
+		var listBlock = null ;
+		if ( FCKBrowserInfo.IsIE )
+		{
+			var range = FCK.EditorDocument.selection.createRange() ;
+			if ( ! range || ! range.findText )
+				return FCK_TRISTATE_DISABLED ;
+			var begin = range.duplicate() ;
+			var end = range.duplicate() ;
+			begin.collapse( true ) ;
+			end.collapse( false ) ;
+			listBlock = this._GetNearestListParent( begin.parentElement(), end.parentElement() ) ;
+		}
+		else
+		{
+			terminals = FCKSelection.GetSelectionTerminals() ;
+			listBlock = this._GetNearestListParent( terminals.startNode, terminals.endNode ) ;
+		}
 		if ( listBlock )
 			return FCK_TRISTATE_ON ;
@@ -72,6 +89,7 @@
 					'end' : endNode,
 					'top' : null,
-					'topDepth' : null ,
+					'topDepth' : null 
 				} ;
+
 				while ( currentNode != endNode )
 				{
@@ -89,5 +107,9 @@
 					for ( var j = 0 ; j < unmarkedNodes.length ; j++ )
 					{
-						FCKDomTools.SetNodeMarker( markerObj, unmarkedNodes[j], '_FCKDepthCounter', 
+						// We can't set an attribute under a non-element node in IE.
+						// So we need to add a check here, and use parentNode._FCKDepthCounter to access
+						// the depth counter most of the time.
+						if ( unmarkedNodes[j].nodeType == 1)
+							FCKDomTools.SetElementMarker( markerObj, unmarkedNodes[j], '_FCKDepthCounter', 
 							       topDepth + 1 + j ) ;
 						/*
@@ -96,10 +118,12 @@
 						*/
 					}
-					if ( currentNode._FCKDepthCounter < shallowestNode._FCKDepthCounter )
+					var currentNodeDepth = ( currentNode.parentNode._FCKDepthCounter || 0 ) + 1 ;
+					var shallowestNodeDepth = ( shallowestNode.parentNode._FCKDepthCounter || 0 ) + 1 ;
+					if ( currentNodeDepth < shallowestNodeDepth )
 						shallowestNode = currentNode ;
 					currentNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
 				}
 				itemRanges[i].top = shallowestNode ;
-				itemRanges[i].topDepth = shallowestNode._FCKDepthCounter ;
+				itemRanges[i].topDepth = ( shallowestNode.parentNode._FCKDepthCounter || 0 ) + 1 ;
 			}
 
@@ -119,5 +143,5 @@
 					var previousImage = null ;
 					var currentImage = null ;
-					while ( ancestor._FCKDepthCounter >= itemRanges[i].topDepth ) 
+					while ( ancestor.parentNode._FCKDepthCounter + 1 >= itemRanges[i].topDepth ) 
 					{
 						if ( ancestor._FCKCurrentImage )
@@ -125,22 +149,33 @@
 						else
 						{
-							/*
-							FCKDebug.Output( i + ":" + ancestor.nodeName + ":" + currentNode.nodeName + 
-									":" + (ancestor == currentNode) ) ;
-							*/
 							currentImage = ancestor.cloneNode( false ) ;
-							FCKDomTools.SetNodeMarker( itemMarkers, ancestor, '_FCKCurrentImage', currentImage ) ;
+							if ( ancestor.nodeType == 1 )
+								FCKDomTools.SetElementMarker( itemMarkers, ancestor, '_FCKCurrentImage', currentImage ) ;
 						}
 						if ( previousImage )
 							currentImage.appendChild( previousImage ) ;
+						/*
+						FCKDebug.Output( i + ":" + ancestor.nodeName + ":" + currentNode.nodeName + 
+								":" + (ancestor == currentNode) + ":" + currentImage.parentNode ) ;
+								*/
 						previousImage = currentImage ;
 						ancestor = ancestor.parentNode ;
 					}
-					if ( currentImage.parentNode == null )
+					/*
+					FCKDebug.Output( i + ":candidateNode:" +  currentImage.nodeName + ":" + 
+							( currentImage.parentNode ? currentImage.parentNode.nodeName : 'null' ) ) ;
+							*/
+					if ( currentImage.parentNode == null 
+							|| ( currentImage.parentNode.nodeType == 11 && currentImage.parentNode != currentFragment ) )
+					{
+						/*
+						FCKDebug.Output( i + ":insertNode:" +  currentImage.nodeName ) ;
+						*/
 						currentFragment.appendChild( currentImage ) ;
+					}
 					currentNode = FCKDomTools.GetNextSourceNode( currentNode ) ;
 				}
 
-				FCKDomTools.ClearNodeMarkers( itemMarkers ) ;
+				FCKDomTools.ClearElementMarkers( itemMarkers ) ;
 			}
 
@@ -154,4 +189,22 @@
 			}
 			*/
+
+			var combinedRange = new FCKDomRange( selectionRange.Window ) ;
+			var itemLength = itemRanges.length ;
+			combinedRange._Range = combinedRange.CreateRange() ;
+			combinedRange._Range.setStart( itemRanges[0].range._Range.startContainer, itemRanges[0].range._Range.startOffset ) ;
+			combinedRange._Range.setEnd( itemRanges[itemLength - 1].range._Range.endContainer, 
+					itemRanges[itemLength - 1].range._Range.endOffset ) ;
+			combinedRange._UpdateElementInfo() ;
+			combinedRange.DeleteContents() ;
+
+			var listNode = selectionRange.Window.document.createElement( this.TagName ) ;
+			while ( itemDocFragments.length > 0 ) 
+			{
+				var itemNode = selectionRange.Window.document.createElement( 'li' ) ;
+				listNode.appendChild( itemNode ) ;
+				itemNode.appendChild( itemDocFragments.shift() ) ;
+			}
+			combinedRange.InsertNode( listNode ) ;
 
 			// Now we should have a list of document fragments corresponding to individual list items.
@@ -205,5 +258,5 @@
 
 			// Clean up all the markings
-			FCKDomTools.ClearNodeMarkers( markerObj ) ;
+			FCKDomTools.ClearElementMarkers( markerObj ) ;
 		}
 		else if ( this.GetState() == FCK_TRISTATE_ON )
Index: /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fck.js	(revision 796)
+++ /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fck.js	(revision 797)
@@ -854,4 +854,7 @@
 		return ;
 
+	if ( FCKConfig.Debug )
+		FCKDebug._GetWindow() ;
+
 	FCK.SetStatus( FCK_STATUS_ACTIVE ) ;
 }
Index: /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fckdomtools.js	(revision 796)
+++ /FCKeditor/branches/features/custom_list_command/editor/_source/internals/fckdomtools.js	(revision 797)
@@ -502,5 +502,5 @@
 	},
 
-	SetNodeMarker : function ( markObj, element, attrName, value)
+	SetElementMarker : function ( markObj, element, attrName, value)
 	{
 		var id = String( parseInt( Math.random() * 0xfffffff, 10 ) ) ;
@@ -512,5 +512,5 @@
 	},
 
-	ClearNodeMarkers : function( markObj )
+	ClearElementMarkers : function( markObj )
 	{
 		for ( var i in markObj )
