Ticket #7087: 7087_3.patch
File 7087_3.patch, 3.9 KB (added by , 13 years ago) |
---|
-
_source/core/dom/walker.js
436 436 { 437 437 return isBookmark( node ) 438 438 || isWhitespaces( node ) 439 || node.type == CKEDITOR.NODE_ELEMENT && node.getName() in CKEDITOR.dtd.$removeEmpty; 439 || node.type == CKEDITOR.NODE_ELEMENT 440 && node.getName() in CKEDITOR.dtd.$inline 441 && !( node.getName() in CKEDITOR.dtd.$empty ); 440 442 }; 441 443 442 444 // Check if there's a filler node at the end of an element, and return it. 443 445 CKEDITOR.dom.element.prototype.getBogus = function() 444 446 { 445 // Bogus are not always at the end, e.g. <p>< strong>text<br /></strong></p> (#7070).447 // Bogus are not always at the end, e.g. <p><a>text<br /></a></p> (#7070). 446 448 var tail = this; 447 449 do { tail = tail.getPreviousSourceNode(); } 448 450 while ( toSkip( tail ) ) -
_source/plugins/styles/plugin.js
430 430 var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span ); 431 431 432 432 // Expand the range. 433 range.enlarge( CKEDITOR.ENLARGE_ELEMENT );433 range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); 434 434 range.trim(); 435 435 436 436 // Get the first node to be processed and the last, which concludes the … … 657 657 * Make sure our range has included all "collpased" parent inline nodes so 658 658 * that our operation logic can be simpler. 659 659 */ 660 range.enlarge( CKEDITOR.ENLARGE_ELEMENT );660 range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); 661 661 662 662 var bookmark = range.createBookmark(), 663 663 startNode = bookmark.startNode; -
_source/core/dom/range.js
823 823 } 824 824 }, 825 825 826 enlarge : function( unit )826 enlarge : function( unit, excludeBrs ) 827 827 { 828 828 switch ( unit ) 829 829 { … … 944 944 // If this is a visible element. 945 945 // We need to check for the bookmark attribute because IE insists on 946 946 // rendering the display:none nodes we use for bookmarks. (#3363) 947 if ( sibling.$.offsetWidth > 0 && !sibling.data( 'cke-bookmark' ) ) 947 // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) 948 if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) 948 949 { 949 950 // We'll accept it only if we need 950 951 // whitespace, and this is an inline … … 1079 1080 if ( commonReached ) 1080 1081 endTop = enlargeable; 1081 1082 else if ( enlargeable ) 1082 { 1083 var bogus = enlargeable.isBlockBoundary() && enlargeable.getBogus(); 1084 1085 // Exclude bogus <br /> at the end of block. 1086 if ( bogus ) 1087 this.setEndBefore( bogus ); 1088 else 1089 this.setEndAfter( enlargeable ); 1090 } 1091 } 1083 this.setEndAfter( enlargeable ); 1084 } 1092 1085 1093 1086 sibling = enlargeable.getNext(); 1094 1087 } … … 1111 1104 // If this is a visible element. 1112 1105 // We need to check for the bookmark attribute because IE insists on 1113 1106 // rendering the display:none nodes we use for bookmarks. (#3363) 1114 if ( sibling.$.offsetWidth > 0 && !sibling.data( 'cke-bookmark' ) ) 1107 // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) 1108 if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) 1115 1109 { 1116 1110 // We'll accept it only if we need 1117 1111 // whitespace, and this is an inline