Index: /CKEditor/trunk/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 3693)
+++ /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 3694)
@@ -284,18 +284,15 @@
 					currentNode = currentNode.parent;
 			}
-			else if ( pendingInline.length > index )
-			{
-				// If we didn't find any parent to be closed, let's check the
-				// pending list.
-				for ( ; index < pendingInline.length ; index++ )
-				{
-					// If found, just remove it from the list.
-					if ( tagName == pendingInline[ index ].name )
-					{
-						pendingInline.splice( index, 1 );
-
-						// Decrease the index so we continue from the next one.
-						index--;
-					}
+
+			// Check if there is any pending tag to be closed.
+			for ( ; index < pendingInline.length ; index++ )
+			{
+				// If found, just remove it from the list.
+				if ( tagName == pendingInline[ index ].name )
+				{
+					pendingInline.splice( index, 1 );
+
+					// Decrease the index so we continue from the next one.
+					index--;
 				}
 			}
Index: /CKEditor/trunk/_source/tests/core/htmlparser/fragment.html
===================================================================
--- /CKEditor/trunk/_source/tests/core/htmlparser/fragment.html	(revision 3693)
+++ /CKEditor/trunk/_source/tests/core/htmlparser/fragment.html	(revision 3694)
@@ -164,9 +164,14 @@
 		},
 
-
 		test_ticket_3585_2 : function()
 		{
 			testParser(	'<b>inline </b>\n<p>paragraph\t\r\n</p>\t\r\n',
 						'<p><b>inline </b></p><p>paragraph</p>' );
+		},
+
+		test_ticket_3744 : function()
+		{
+			testParser(	'<div><b><font><span>A</font></span></b></div><div>X</div>',
+						'<div><b><font><span>A</span></font></b></div><div>X</div>' );
 		},
 
