X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Ffragment.js;h=2d7f8ac1a2dc4af55694c1a2f1983147b5b3becd;hb=fb481ba0a7d298e3e7b9034fcb9f2afdc6e8e796;hp=bfa5cc57925c31bcd800e086e33f45a154e07f5c;hpb=f0610347140239143439a511ee2bd48cb784f470;p=ckeditor.git diff --git a/_source/core/htmlparser/fragment.js b/_source/core/htmlparser/fragment.js index bfa5cc5..2d7f8ac 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