Ticket #7894: 7894.patch

File 7894.patch, 1.2 KB (added by Garry Yao, 13 years ago)
  • _source/core/htmlparser/fragment.js

     
    4949        // Dtd of the fragment element, basically it accept anything except for intermediate structure, e.g. orphan <li>.
    5050        var rootDtd = CKEDITOR.tools.extend( {}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style:1,script:1 } );
    5151
     52        function isRemoveEmpty( node )
     53        {
     54                // Empty link is to be removed when empty but not anchor. (#7894)
     55                return node.name == 'a' && node.attributes.href
     56                        || CKEDITOR.dtd.$removeEmpty[ node.name ];
     57        }
     58
    5259        /**
    5360         * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string.
    5461         * @param {String} fragmentHtml The HTML to be parsed, filling the fragment.
     
    200207                        element.isOptionalClose = tagName in optionalCloseTags || optionalClose;
    201208
    202209                        // This is a tag to be removed if empty, so do not add it immediately.
    203                         if ( CKEDITOR.dtd.$removeEmpty[ tagName ] )
     210                        if ( isRemoveEmpty( element ) )
    204211                        {
    205212                                pendingInline.push( element );
    206213                                return;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy