X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fcore%2Fhtmlparser%2Ffragment.js;h=a80fd1d57c0d042eeb08adc3b71121e39da0d977;hb=refs%2Ftags%2Fv3.6.3;hp=bfa5cc57925c31bcd800e086e33f45a154e07f5c;hpb=f0610347140239143439a511ee2bd48cb784f470;p=ckeditor.git diff --git a/_source/core/htmlparser/fragment.js b/_source/core/htmlparser/fragment.js index bfa5cc5..a80fd1d 100644 --- a/_source/core/htmlparser/fragment.js +++ b/_source/core/htmlparser/fragment.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -49,6 +49,13 @@ CKEDITOR.htmlParser.fragment = function() // 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. @@ -67,6 +74,8 @@ CKEDITOR.htmlParser.fragment = function() pendingInline = [], pendingBRs = [], currentNode = fragment, + // Indicate we're inside a