Index: _source/plugins/htmldataprocessor/plugin.js
===================================================================
--- _source/plugins/htmldataprocessor/plugin.js (revision 5878)
+++ _source/plugins/htmldataprocessor/plugin.js (revision )
@@ -317,6 +317,11 @@
return html.replace( protectSelfClosingRegex, '
]*>)(\r\n|\n)/g, '$1$2$2' ); + } + function protectRealComments( html ) { return html.replace( //g, function( match ) @@ -437,6 +442,10 @@ // protecting them into open-close. (#3591) data = protectSelfClosingElements( data ); + // Compensate one leading line break afteropen as browsers + // eat it up. (#5789) + data = protectPreFormatted( data ); + // Call the browser to help us fixing a possibly invalid HTML // structure. var div = new CKEDITOR.dom.element( 'div' ); Index: _source/plugins/htmlwriter/plugin.js =================================================================== --- _source/plugins/htmlwriter/plugin.js (revision 5336) +++ _source/plugins/htmlwriter/plugin.js (revision ) @@ -63,6 +63,8 @@ this._.indent = false; this._.indentation = ''; + // Indicate preformatted block context status. (#5789) + this._.inPre = 0; this._.rules = {}; var dtd = CKEDITOR.dtd; @@ -158,6 +160,7 @@ if ( rules && rules.breakAfterOpen ) this.lineBreak(); + tagName == 'pre' && ( this._.inPre = 1 ); }, /** @@ -206,6 +209,7 @@ } this._.output.push( '', tagName, '>' ); + tagName == 'pre' && ( this._.inPre = 0 ); if ( rules && rules.breakAfterClose ) this.lineBreak(); @@ -223,7 +227,7 @@ if ( this._.indent ) { this.indentation(); - text = CKEDITOR.tools.ltrim( text ); + !this._.inPre && ( text = CKEDITOR.tools.ltrim( text ) ); } this._.output.push( text ); @@ -252,7 +256,7 @@ */ lineBreak : function() { - if ( this._.output.length > 0 ) + if ( !this._.inPre && this._.output.length > 0 ) this._.output.push( this.lineBreakChars ); this._.indent = true; }, @@ -267,7 +271,8 @@ */ indentation : function() { + if( !this._.inPre ) - this._.output.push( this._.indentation ); + this._.output.push( this._.indentation ); this._.indent = false; },