X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Ffragment.js;h=f69f7cdca5a42b1ea0b63a5b353e5ca20a81f35b;hb=e73319a12b56100b29ef456fd74114fe5519e01c;hp=8c3ad5d3b960f98564078c2e139cfc93b6280f91;hpb=4e90e78dc97789709ee7404359a5517540c27553;p=ckeditor.git diff --git a/_source/core/htmlparser/fragment.js b/_source/core/htmlparser/fragment.js index 8c3ad5d..f69f7cd 100644 --- a/_source/core/htmlparser/fragment.js +++ b/_source/core/htmlparser/fragment.js @@ -41,11 +41,21 @@ CKEDITOR.htmlParser.fragment = function() // parser fixing. var nonBreakingBlocks = CKEDITOR.tools.extend( { table:1,ul:1,ol:1,dl:1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ); + // IE < 8 don't output the close tag on definition list items. (#6975) + var optionalCloseTags = CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? { dd : 1, dt :1 } : {}; + var listBlocks = { ol:1, ul:1 }; // 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. @@ -64,6 +74,8 @@ CKEDITOR.htmlParser.fragment = function() pendingInline = [], pendingBRs = [], currentNode = fragment, + // Indicate we're inside a