Ticket #5595: 5595_2.patch
File 5595_2.patch, 2.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/htmldataprocessor/plugin.js
317 317 return html.replace( protectSelfClosingRegex, '<cke:$1$2></cke:$1>' ); 318 318 } 319 319 320 function protectPreFormatted( html ) 321 { 322 return html.replace( /(<pre\b[^>]*>)(\r\n|\n)/g, '$1$2$2' ); 323 } 324 320 325 function protectRealComments( html ) 321 326 { 322 327 return html.replace( /<!--(?!{cke_protected})[\s\S]+?-->/g, function( match ) … … 437 442 // protecting them into open-close. (#3591) 438 443 data = protectSelfClosingElements( data ); 439 444 445 // Compensate one leading line break after <pre> open as browsers 446 // eat it up. (#5789) 447 data = protectPreFormatted( data ); 448 440 449 // Call the browser to help us fixing a possibly invalid HTML 441 450 // structure. 442 451 var div = new CKEDITOR.dom.element( 'div' ); -
_source/plugins/htmlwriter/plugin.js
63 63 64 64 this._.indent = false; 65 65 this._.indentation = ''; 66 // Indicate preformatted block context status. (#5789) 67 this._.inPre = 0; 66 68 this._.rules = {}; 67 69 68 70 var dtd = CKEDITOR.dtd; … … 158 160 159 161 if ( rules && rules.breakAfterOpen ) 160 162 this.lineBreak(); 163 tagName == 'pre' && ( this._.inPre = 1 ); 161 164 }, 162 165 163 166 /** … … 206 209 } 207 210 208 211 this._.output.push( '</', tagName, '>' ); 212 tagName == 'pre' && ( this._.inPre = 0 ); 209 213 210 214 if ( rules && rules.breakAfterClose ) 211 215 this.lineBreak(); … … 223 227 if ( this._.indent ) 224 228 { 225 229 this.indentation(); 226 text = CKEDITOR.tools.ltrim( text);230 !this._.inPre && ( text = CKEDITOR.tools.ltrim( text ) ); 227 231 } 228 232 229 233 this._.output.push( text ); … … 252 256 */ 253 257 lineBreak : function() 254 258 { 255 if ( this._.output.length > 0 )259 if ( !this._.inPre && this._.output.length > 0 ) 256 260 this._.output.push( this.lineBreakChars ); 257 261 this._.indent = true; 258 262 }, … … 267 271 */ 268 272 indentation : function() 269 273 { 270 this._.output.push( this._.indentation ); 274 if( !this._.inPre ) 275 this._.output.push( this._.indentation ); 271 276 this._.indent = false; 272 277 }, 273 278