Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 4621)
+++ /CKEditor/trunk/CHANGES.html	(revision 4622)
@@ -89,4 +89,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/4594">#4594</a> : Fixed context menu goes off-screen when mouse is at right had side of screen.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/4673">#4673</a> : Fixed undo not available straight away if shift key is used to enter first character.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4690">#4690</a> : Fixed the parsing of nested inline elements.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 4621)
+++ /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 4622)
@@ -265,6 +265,16 @@
 		parser.onTagClose = function( tagName )
 		{
-			var index = 0,
-				pendingAdd = [],
+			// Check if there is any pending tag to be closed.
+			for ( var i = pendingInline.length - 1 ; i >= 0 ; i-- )
+			{
+				// If found, just remove it from the list.
+				if ( tagName == pendingInline[ i ].name )
+				{
+					pendingInline.splice( i, 1 );
+					return;
+				}
+			}
+
+			var pendingAdd = [],
 				candidate = currentNode;
 
@@ -274,11 +284,5 @@
 				// it will continue after the closing tag.
 				if ( !candidate._.isBlockLike )
-				{
 					pendingInline.unshift( candidate );
-
-					// Increase the index, so it will not get checked again in
-					// the pending list check that follows.
-					index++;
-				}
 
 				// This node should be added to it's parent at this point. But,
@@ -310,24 +314,4 @@
 				if ( candidate == currentNode )
 					currentNode = currentNode.parent;
-			}
-			// The tag is not actually closing anything, thus we need invalidate
-			// the pending elements.(#3862)
-			else
-			{
-				pendingInline.splice( 0, index );
-				index = 0;
-			}
-
-			// 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--;
-				}
 			}
 		};
