Index: _source/core/htmlparser/fragment.js
===================================================================
--- _source/core/htmlparser/fragment.js (revision 7008)
+++ _source/core/htmlparser/fragment.js (revision )
@@ -49,6 +49,13 @@
// 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 ];
+ }
+
/**
* Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string.
* @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
@@ -200,7 +207,7 @@
element.isOptionalClose = tagName in optionalCloseTags || optionalClose;
// 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 );
return;