Ticket #6771: 6771.patch
File 6771.patch, 3.7 KB (added by , 13 years ago) |
---|
-
_source/core/htmlparser/fragment.js
64 64 html = [], 65 65 fragment = new CKEDITOR.htmlParser.fragment(), 66 66 pendingInline = [], 67 pendingBRs = [],68 67 currentNode = fragment, 69 68 // Indicate we're inside a <pre> element, spaces should be touched differently. 70 69 inPre = false, … … 72 71 73 72 function checkPending( newTagName ) 74 73 { 75 var pendingBRsSent;76 77 74 if ( pendingInline.length > 0 ) 78 75 { 79 76 for ( var i = 0 ; i < pendingInline.length ; i++ ) … … 85 82 86 83 if ( ( !currentDtd || currentDtd[ pendingName ] ) && ( !newTagName || !pendingDtd || pendingDtd[ newTagName ] || !CKEDITOR.dtd[ newTagName ] ) ) 87 84 { 88 if ( !pendingBRsSent )89 {90 sendPendingBRs();91 pendingBRsSent = 1;92 }93 94 85 // Get a clone for the pending element. 95 86 pendingElement = pendingElement.clone(); 96 87 … … 108 99 } 109 100 } 110 101 111 function sendPendingBRs( brsToIgnore )112 {113 while ( pendingBRs.length - ( brsToIgnore || 0 ) > 0 )114 currentNode.add( pendingBRs.shift() );115 }116 117 102 function addElement( element, target, enforceCurrent ) 118 103 { 119 104 target = target || currentNode || fragment; … … 196 181 return; 197 182 } 198 183 199 if ( tagName == 'br' )200 {201 pendingBRs.push( element );202 return;203 }204 205 184 var currentName = currentNode.name; 206 185 207 186 var currentDtd = currentName … … 280 259 } 281 260 282 261 checkPending( tagName ); 283 sendPendingBRs();284 262 285 263 element.parent = currentNode; 286 264 element.returnPoint = returnPoint; … … 339 317 if ( currentNode.name == 'pre' ) 340 318 inPre = false; 341 319 342 if ( candidate._.isBlockLike )343 sendPendingBRs();344 345 320 addElement( candidate, candidate.parent ); 346 321 347 322 // The parent should start receiving new nodes now, except if … … 367 342 return; 368 343 } 369 344 370 sendPendingBRs();371 345 checkPending(); 372 346 373 347 if ( fixForBody … … 399 373 // Parse it. 400 374 parser.parse( fragmentHtml ); 401 375 402 // Send all pending BRs except one, which we consider a unwanted bogus. (#5293)403 sendPendingBRs( !CKEDITOR.env.ie && 1 );404 405 376 // Close all pending nodes. 406 377 while ( currentNode.type ) 407 378 { -
_source/core/dom/range.js
922 922 // If this is a visible element. 923 923 // We need to check for the bookmark attribute because IE insists on 924 924 // rendering the display:none nodes we use for bookmarks. (#3363) 925 if ( sibling.$.offsetWidth > 0 && !sibling.getAttribute( '_cke_bookmark' ) ) 925 // <br> is invisible, don't miss it. (#4886) 926 if ( sibling.$.offsetWidth > 0 && !sibling.getAttribute( '_cke_bookmark' ) || sibling.is( 'br' ) ) 926 927 { 927 928 // We'll accept it only if we need 928 929 // whitespace, and this is an inline … … 1081 1082 // If this is a visible element. 1082 1083 // We need to check for the bookmark attribute because IE insists on 1083 1084 // rendering the display:none nodes we use for bookmarks. (#3363) 1084 if ( sibling.$.offsetWidth > 0 && !sibling.getAttribute( '_cke_bookmark' ) ) 1085 // <br> is invisible, don't miss it. (#4886) 1086 if ( sibling.$.offsetWidth > 0 && !sibling.getAttribute( '_cke_bookmark' ) || sibling.is( 'br' ) ) 1085 1087 { 1086 1088 // We'll accept it only if we need 1087 1089 // whitespace, and this is an inline