Index: /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2202)
+++ /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2203)
@@ -1032,39 +1032,24 @@
 		var endNode = range.EndNode ;
 		var elementMarkers = {} ;
-
-		var startPath = new FCKElementPath( startNode ) ;
-		if ( startPath.BlockLimit && startPath.BlockLimit.nodeName.IEquals( 'div' ) )
-			startNode = startPath.BlockLimit ;
 		var currentNode = startNode ;
-
-		do
-		{
-			var child = currentNode.firstChild ;
-			while ( child && child.nodeType != 1 )
-				child = child.nextSibling ;
-
-			if ( currentNode.nodeName.IEquals( 'div' ) && child &&
-					FCKListsLib.BlockElements[ child.nodeName.toLowerCase() ] )
-			{
-				// This is a block limit node.
-				currentBlocks.push( currentNode ) ;
-				if ( currentNode.parentNode.nodeName.IEquals( 'div' ) )
-					FCKDomTools.SetElementMarker( elementMarkers, currentNode.parentNode,
-							'_fckignorethisnode', true ) ;
-			}
-			else
-			{
-				// This is not a block limit node.
-				FCKDomTools.SetElementMarker( elementMarkers, currentNode.parentNode,
-						'_fckincludethisnode', true ) ;
-			}
-		}
-		while ( ( currentNode = FCKDomTools.GetNextSourceElement( currentNode ) ) && currentNode != endNode
-				&& currentNode != endNode.parentNode ) ;
-
-		for ( var i = currentBlocks.length - 1 ; i >= 0 ; i-- )
-		{
-			if ( currentBlocks[i]['_fckignorethisnode'] && !currentBlocks[i]['_fckincludethisnode'] )
-				currentBlocks.splice( i, 1 ) ;
+		
+		if ( startNode == endNode )
+		{
+			while ( endNode.lastChild )
+				endNode = endNode.lastChild ;
+			endNode = FCKDomTools.GetNextSourceElement( endNode ) ;
+		}
+
+		while ( currentNode != endNode && currentNode != endNode.parentNode )
+		{
+			var path = new FCKElementPath( currentNode ) ;
+			var blockLimit = path.BlockLimit ;
+			if ( blockLimit && blockLimit.nodeName.IEquals( 'div' ) && !blockLimit['_fckdivincluded'] )
+			{
+				currentBlocks.push( blockLimit ) ;
+				FCKDomTools.SetElementMarker( elementMarkers, blockLimit, '_fckdivincluded', true ) ;
+			}
+
+			currentNode = FCKDomTools.GetNextSourceElement( currentNode ) ;
 		}
 
