- returnPoint = currentNode, addPoint = lastChild;\r
- }\r
- // If the element name is the same as the current element name,\r
- // then just close the current one and append the new one to the\r
- // parent. This situation usually happens with <p>, <li>, <dt> and\r
- // <dd>, specially in IE. Do not enter in this if block in this case.\r
- else if ( tagName == currentName )\r
- {\r
- addElement( currentNode, currentNode.parent );\r
- }\r
- else\r
- {\r
- if ( nonBreakingBlocks[ currentName ] )\r
+ !element.returnPoint && ( element.returnPoint = currentNode );\r
+ currentNode = lastChild;\r
+ }\r
+ // Establish new list root for orphan list items.\r
+ else if ( tagName in CKEDITOR.dtd.$listItem && currentName != tagName )\r
+ parser.onTagOpen( tagName == 'li' ? 'ul' : 'dl', {}, 0, 1 );\r
+ // We're inside a structural block like table and list, AND the incoming element\r
+ // is not of the same type (e.g. <td>td1<td>td2</td>), we simply add this new one before it,\r
+ // and most importantly, return back to here once this element is added,\r
+ // e.g. <table><tr><td>td1</td><p>p1</p><td>td2</td></tr></table>\r
+ else if ( currentName in nonBreakingBlocks && currentName != tagName )\r