Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 7222)
+++ /CKEditor/trunk/CHANGES.html	(revision 7223)
@@ -70,4 +70,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/8087">#8087</a> : Indenting list items may add redundant text direction attributes.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/6200">#6200</a> : Styling for certain dialog element type that miss focus outline like checkbox.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7894">#7894</a> : Fault tolerance when parsing malformed link.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/8128">#8128</a> : Italian;</li>
Index: /CKEditor/trunk/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 7222)
+++ /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 7223)
@@ -49,4 +49,11 @@
 	// Dtd of the fragment element, basically it accept anything except for intermediate structure, e.g. orphan <li>.
 	var rootDtd = CKEDITOR.tools.extend( {}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style:1,script:1 } );
+
+	function isRemoveEmpty( node )
+	{
+		// Empty link is to be removed when empty but not anchor. (#7894)
+		return node.name == 'a' && node.attributes.href
+			|| CKEDITOR.dtd.$removeEmpty[ node.name ];
+	}
 
 	/**
@@ -105,4 +112,11 @@
 						i--;
 					}
+					else
+					{
+						// Some element of the same type cannot be nested, flat them,
+						// e.g. <a href="#">foo<a href="#">bar</a></a>. (#7894)
+						if ( pendingName == currentNode.name )
+							addElement( currentNode, currentNode.parent, 1 ), i--;
+					}
 				}
 			}
@@ -201,5 +215,5 @@
 
 			// This is a tag to be removed if empty, so do not add it immediately.
-			if ( CKEDITOR.dtd.$removeEmpty[ tagName ] )
+			if ( isRemoveEmpty( element ) )
 			{
 				pendingInline.push( element );
