Ticket #5335: 5335_3.patch
File 5335_3.patch, 3.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/domiterator/plugin.js
44 44 // Indicats that the current element in the loop is the last one. 45 45 var isLast; 46 46 47 // Indicate at least one of the range boundaries is inside a preformat block. 48 var touchPre; 49 47 50 // Instructs to cleanup remaining BRs. 48 51 var removePreviousBr, removeLastBr; 49 52 … … 55 58 // Shrink the range to exclude harmful "noises" (#4087, #4450, #5435). 56 59 range.shrink( CKEDITOR.NODE_ELEMENT, true ); 57 60 58 range.enlarge( this.forceBrBreak || !this.enlargeBr ? 61 touchPre = range.endContainer.hasAscendant( 'pre', true ) 62 || range.startContainer.hasAscendant( 'pre', true ); 63 64 range.enlarge( this.forceBrBreak && !touchPre || !this.enlargeBr ? 59 65 CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS ); 60 66 61 67 var walker = new CKEDITOR.dom.walker( range ), … … 106 112 { 107 113 // closeRange indicates that a paragraph boundary has been found, 108 114 // so the range can be closed. 109 var closeRange = false; 115 var closeRange = false, 116 parentPre = currentNode.hasAscendant( 'pre' ); 110 117 111 118 // includeNode indicates that the current node is good to be part 112 119 // of the range. By default, any non-element node is ok for it. … … 119 126 { 120 127 var nodeName = currentNode.getName(); 121 128 122 if ( currentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) ) 129 if ( currentNode.isBlockBoundary( this.forceBrBreak && 130 !parentPre && { br : 1 } ) ) 123 131 { 124 132 // <br> boundaries must be part of the range. It will 125 133 // happen only if ForceBrBreak. … … 193 201 { 194 202 var parentNode = currentNode.getParent(); 195 203 196 if ( parentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) ) 204 if ( parentNode.isBlockBoundary( this.forceBrBreak 205 && !parentPre && { br : 1 } ) ) 197 206 { 198 207 closeRange = true; 199 208 isLast = isLast || ( parentNode.equals( lastNode) ); -
_source/plugins/list/plugin.js
299 299 var contentBlock = listContents.shift(), 300 300 listItem = doc.createElement( 'li' ); 301 301 302 // Preserve heading structure when converting to list item.(#5271)303 if ( headerTagRegex.test( contentBlock.getName() ) )302 // Preserve preformat block and heading structure when converting to list item. (#5335) (#5271) 303 if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) ) 304 304 contentBlock.appendTo( listItem ); 305 305 else 306 306 { … … 312 312 contentBlock.copyAttributes( listItem ); 313 313 contentBlock.moveChildren( listItem ); 314 314 contentBlock.remove(); 315 316 // Append a bogus BR to force the LI to render at full height 317 if ( !CKEDITOR.env.ie ) 318 listItem.appendBogus(); 315 319 } 316 320 317 321 listItem.appendTo( listNode ); 318 319 // Append a bogus BR to force the LI to render at full height320 if ( !CKEDITOR.env.ie )321 listItem.appendBogus();322 322 } 323 323 324 324 if ( dir )