Ticket #5335: 5335_2.patch
File 5335_2.patch, 3.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/list/plugin.js
288 288 var contentBlock = listContents.shift(), 289 289 listItem = doc.createElement( 'li' ); 290 290 291 // Preserve heading structure when converting to list item.(#5271)292 if ( headerTagRegex.test( contentBlock.getName() ) )291 // Preserve preformat block and heading structure when converting to list item. (#5335) (#5271) 292 if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) ) 293 293 contentBlock.appendTo( listItem ); 294 294 else 295 295 { 296 296 contentBlock.copyAttributes( listItem ); 297 297 contentBlock.moveChildren( listItem ); 298 298 contentBlock.remove(); 299 }300 299 301 listItem.appendTo( listNode ); 302 303 // Append a bogus BR to force the LI to render at full height 304 if ( !CKEDITOR.env.ie ) 305 listItem.appendBogus(); 306 } 300 // Append a bogus BR to force the LI to render at full height 301 if ( !CKEDITOR.env.ie ) 302 listItem.appendBogus(); 303 } 304 305 listItem.appendTo( listNode ); 306 } 307 307 if ( insertAnchor ) 308 308 listNode.insertBefore( insertAnchor ); 309 309 else -
_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 … … 51 54 if ( !this._.lastNode ) 52 55 { 53 56 range = this.range.clone(); 54 range.enlarge( this.forceBrBreak || !this.enlargeBr ? 57 58 touchPre = range.endContainer.hasAscendant( 'pre', true ) 59 || range.startContainer.hasAscendant( 'pre', true ); 60 61 range.enlarge( this.forceBrBreak && !touchPre || !this.enlargeBr ? 55 62 CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS ); 56 63 57 64 var walker = new CKEDITOR.dom.walker( range ), … … 102 109 { 103 110 // closeRange indicates that a paragraph boundary has been found, 104 111 // so the range can be closed. 105 var closeRange = false; 112 var closeRange = false, 113 parentPre = currentNode.hasAscendant( 'pre' ); 106 114 107 115 // includeNode indicates that the current node is good to be part 108 116 // of the range. By default, any non-element node is ok for it. … … 115 123 { 116 124 var nodeName = currentNode.getName(); 117 125 118 if ( currentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) ) 126 if ( currentNode.isBlockBoundary( this.forceBrBreak && 127 !parentPre && { br : 1 } ) ) 119 128 { 120 129 // <br> boundaries must be part of the range. It will 121 130 // happen only if ForceBrBreak. … … 189 198 { 190 199 var parentNode = currentNode.getParent(); 191 200 192 if ( parentNode.isBlockBoundary( this.forceBrBreak && { br : 1 } ) ) 201 if ( parentNode.isBlockBoundary( this.forceBrBreak 202 && !parentPre && { br : 1 } ) ) 193 203 { 194 204 closeRange = true; 195 205 isLast = isLast || ( parentNode.equals( lastNode) );