X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fhtmlparser%2Ffragment.js;h=9db04dd8b0bd8eff3ed3ce966bdb7eb4a547bb0c;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=ad1c93edb2211aafad75bb83bb5f0d51a3b403cd;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_source/core/htmlparser/fragment.js b/_source/core/htmlparser/fragment.js index ad1c93e..9db04dd 100644 --- a/_source/core/htmlparser/fragment.js +++ b/_source/core/htmlparser/fragment.js @@ -108,9 +108,9 @@ CKEDITOR.htmlParser.fragment = function() } } - function sendPendingBRs() + function sendPendingBRs( brsToIgnore ) { - while ( pendingBRs.length ) + while ( pendingBRs.length - ( brsToIgnore || 0 ) > 0 ) currentNode.add( pendingBRs.shift() ); } @@ -237,6 +237,12 @@ CKEDITOR.htmlParser.fragment = function() { addElement( currentNode, currentNode.parent ); } + else if ( tagName in CKEDITOR.dtd.$listItem ) + { + parser.onTagOpen( 'ul', {} ); + addPoint = currentNode; + reApply = true; + } else { if ( nonBreakingBlocks[ currentName ] ) @@ -274,6 +280,7 @@ CKEDITOR.htmlParser.fragment = function() } checkPending( tagName ); + sendPendingBRs(); element.parent = currentNode; element.returnPoint = returnPoint; @@ -385,13 +392,15 @@ CKEDITOR.htmlParser.fragment = function() parser.onComment = function( comment ) { + checkPending(); currentNode.add( new CKEDITOR.htmlParser.comment( comment ) ); }; // Parse it. parser.parse( fragmentHtml ); - sendPendingBRs(); + // Send all pending BRs except one, which we consider a unwanted bogus. (#5293) + sendPendingBRs( !CKEDITOR.env.ie && 1 ); // Close all pending nodes. while ( currentNode.type )