/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
}\r
}\r
\r
- function sendPendingBRs()\r
+ function sendPendingBRs( brsToIgnore )\r
{\r
- while ( pendingBRs.length )\r
+ while ( pendingBRs.length - ( brsToIgnore || 0 ) > 0 )\r
currentNode.add( pendingBRs.shift() );\r
}\r
\r
{\r
target = target || currentNode || fragment;\r
\r
- // If the target is the fragment and this element can't go inside\r
+ // If the target is the fragment and this inline element can't go inside\r
// body (if fixForBody).\r
if ( fixForBody && !target.type )\r
{\r
var elementName, realElementName;\r
if ( element.attributes\r
&& ( realElementName =\r
- element.attributes[ '_cke_real_element_type' ] ) )\r
+ element.attributes[ 'data-cke-real-element-type' ] ) )\r
elementName = realElementName;\r
else\r
elementName = element.name;\r
- if ( elementName\r
- && !( elementName in CKEDITOR.dtd.$body )\r
- && !( elementName in CKEDITOR.dtd.$nonBodyContent ) )\r
+\r
+ if ( elementName && elementName in CKEDITOR.dtd.$inline )\r
{\r
var savedCurrent = currentNode;\r
\r
{\r
addElement( currentNode, currentNode.parent );\r
}\r
+ else if ( tagName in CKEDITOR.dtd.$listItem )\r
+ {\r
+ parser.onTagOpen( 'ul', {} );\r
+ addPoint = currentNode;\r
+ reApply = true;\r
+ }\r
else\r
{\r
if ( nonBreakingBlocks[ currentName ] )\r
\r
parser.onComment = function( comment )\r
{\r
+ sendPendingBRs();\r
+ checkPending();\r
currentNode.add( new CKEDITOR.htmlParser.comment( comment ) );\r
};\r
\r
// Parse it.\r
parser.parse( fragmentHtml );\r
\r
- sendPendingBRs();\r
+ // Send all pending BRs except one, which we consider a unwanted bogus. (#5293)\r
+ sendPendingBRs( !CKEDITOR.env.ie && 1 );\r
\r
// Close all pending nodes.\r
while ( currentNode.type )\r