Index: /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js	(revision 962)
+++ /MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js	(revision 963)
@@ -56,4 +56,5 @@
 {
 	_inPre : false,
+	_inLSpace : false,	
 
 	/*
@@ -169,7 +170,9 @@
 					return ;
 
-				if ( sNodeName == 'br' && FCK.DataProcessor._inPre )
+				if ( sNodeName == 'br' && ( this._inPre || this._inLSpace ) ) 
 				{
 					stringBuilder.push( "\n" ) ;
+					if ( this._inLSpace )
+						stringBuilder.push( " " ) ;
 					return ;
 				}
@@ -414,18 +417,32 @@
 						case 'pre' :
 							var attribs = this._GetAttributesStr( htmlNode ) ;
-
-							stringBuilder.push( '<' ) ;
-							stringBuilder.push( sNodeName ) ;
-
-							if ( attribs.length > 0 )
-								stringBuilder.push( attribs ) ;
-
-							stringBuilder.push( '>' ) ;
-							FCK.DataProcessor._inPre = true ;
-							this._AppendChildNodes( htmlNode, stringBuilder ) ;
-							FCK.DataProcessor._inPre = false ;
-							stringBuilder.push( '<\/' ) ;
-							stringBuilder.push( sNodeName ) ;
-							stringBuilder.push( '>' ) ;
+							
+							if ( htmlNode.className == "_fck_mw_lspace")
+							{
+								stringBuilder.push( "\n " ) ;
+								this._inLSpace = true ;
+								this._AppendChildNodes( htmlNode, stringBuilder ) ;
+								this._inLSpace = false ;
+								if ( stringBuilder[stringBuilder.length-2] == "\n" && stringBuilder[stringBuilder.length-1] == " " )
+									stringBuilder.pop() ;
+								else
+									stringBuilder.push( "\n" ) ;
+							}
+							else
+							{
+								stringBuilder.push( '<' ) ;
+								stringBuilder.push( sNodeName ) ;
+
+								if ( attribs.length > 0 )
+									stringBuilder.push( attribs ) ;
+
+								stringBuilder.push( '>' ) ;
+								this._inPre = true ;
+								this._AppendChildNodes( htmlNode, stringBuilder ) ;
+								this._inPre = false ;
+								stringBuilder.push( '<\/' ) ;
+								stringBuilder.push( sNodeName ) ;
+								stringBuilder.push( '>' ) ;								
+							}
 						
 							break ;
@@ -464,14 +481,17 @@
 
 					if ( !htmlNode.previousSibling ||
-					( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) )
+					( stringBuilder.length > 0 && stringBuilder[ stringBuilder.length - 1 ].EndsWith( '\n' ) ) && !this._inLSpace )
 					{
 						textValue = textValue.LTrim() ;
 					}
 
-					if ( !htmlNode.nextSibling )
+					if ( !htmlNode.nextSibling && !this._inLSpace )
 						textValue = textValue.RTrim() ;
 
 					textValue = textValue.replace( / {2,}/g, ' ' ) ;
 
+					if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 )
+						textValue = textValue + " " ;
+					
 					if ( this._IsInsideCell )
 						textValue = textValue.replace( /\|/g, '&#124;' ) ;
Index: /MediaWiki/trunk/includes/Parser.php
===================================================================
--- /MediaWiki/trunk/includes/Parser.php	(revision 962)
+++ /MediaWiki/trunk/includes/Parser.php	(revision 963)
@@ -2160,5 +2160,5 @@
 						if ($this->mLastSection != 'pre') {
 							$paragraphStack = false;
-							$output .= $this->closeParagraph().'<pre>';
+							$output .= $this->closeParagraph().'<pre class="_fck_mw_lspace">';
 							$this->mLastSection = 'pre';
 						}
