Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 7222)
+++ /CKEditor/trunk/CHANGES.html (revision 7223)
@@ -70,4 +70,5 @@
#8087 : Indenting list items may add redundant text direction attributes.
#6200 : Styling for certain dialog element type that miss focus outline like checkbox.
+ #7894 : Fault tolerance when parsing malformed link.
Updated the following language files:
- #8128 : Italian;
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 - .
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. foobar. (#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 );