Ticket #7494: 7494.patch
File 7494.patch, 2.5 KB (added by , 14 years ago) |
---|
-
_source/core/htmlparser/fragment.js
112 112 } 113 113 114 114 /* 115 * Beside of simply append specified element to target, this functionalso takes115 * Beside of simply append specified element to target, it also takes 116 116 * care of other dirty lifts like forcing block in body, trimming spaces at 117 117 * the block boundaries etc. 118 * 118 * 119 119 * @param {Element} element The element to be added as the last child of {@link target}. 120 120 * @param {Element} target The parent element to relieve the new node. 121 * @param {Boolean} [moveCurrent=false] Don't change the "currentNode" global unless122 * there's a return point node specified on the element, otherwise move current onto {@link target} node.123 121 */ 124 function addElement( element, target , moveCurrent)122 function addElement( element, target ) 125 123 { 126 124 // Ignore any element that has already been added. 127 125 if ( element.previous !== undefined ) … … 181 179 delete element.returnPoint; 182 180 } 183 181 else 184 currentNode = moveCurrent ? target :savedCurrent;182 currentNode = savedCurrent; 185 183 } 186 184 187 185 parser.onTagOpen = function( tagName, attributes, selfClosing ) … … 260 258 // The most common case where we just need to close the 261 259 // current one and append the new one to the parent. 262 260 if ( currentNode.parent ) 263 addElement( currentNode, currentNode.parent, 1 ); 261 { 262 addElement( currentNode, currentNode.parent ); 263 currentNode = currentNode.parent; 264 } 264 265 // We've tried our best to fix the embarrassment here, while 265 266 // this element still doesn't find it's parent, mark it as 266 267 // orphan and show our tolerance to it. … … 398 399 // Send all pending BRs except one, which we consider a unwanted bogus. (#5293) 399 400 sendPendingBRs( !CKEDITOR.env.ie && 1 ); 400 401 401 // Close all pending nodes , make sure return point is properly restored.402 // Close all pending nodes. 402 403 while ( currentNode != fragment ) 403 addElement( currentNode, currentNode.parent, 1 ); 404 { 405 // Make sure return point is properly restored. 406 var returnPoint = currentNode.returnPoint; 407 addElement( currentNode, currentNode.parent ); 408 currentNode = returnPoint || currentNode.parent; 409 } 404 410 405 411 return fragment; 406 412 };