Index: /FCKeditor/trunk/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 719)
+++ /FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 720)
@@ -137,5 +137,5 @@
 	},
 
-	CheckIsEmpty : function( ignoreEndBRs )
+	CheckIsEmpty : function()
 	{
 		if ( this.CheckIsCollapsed() )
@@ -146,5 +146,5 @@
 		this._Range.cloneContents().AppendTo( eToolDiv ) ;
 
-		FCKDomTools.TrimNode( eToolDiv, ignoreEndBRs ) ;
+		FCKDomTools.TrimNode( eToolDiv ) ;
 
 		return ( eToolDiv.innerHTML.length == 0 ) ;
@@ -187,5 +187,5 @@
 			var eToolDiv = this.Window.document.createElement( 'div' ) ;
 			oTestRange._Range.cloneContents().AppendTo( eToolDiv ) ;
-			FCKDomTools.TrimNode( eToolDiv, true ) ;
+			FCKDomTools.TrimNode( eToolDiv ) ;
 
 			// Find out if we are in an empty tree of inline elements, like <b><i><span></span></i></b>
Index: /FCKeditor/trunk/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 719)
+++ /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 720)
@@ -35,8 +35,8 @@
 
 	// Remove blank spaces from the beginning and the end of the contents of a node.
-	TrimNode : function( node, ignoreEndBRs )
+	TrimNode : function( node )
 	{
 		this.LTrimNode( node ) ;
-		this.RTrimNode( node, ignoreEndBRs ) ;
+		this.RTrimNode( node ) ;
 	},
 
@@ -67,5 +67,5 @@
 	},
 
-	RTrimNode : function( node, ignoreEndBRs )
+	RTrimNode : function( node )
 	{
 		var eChildNode ;
@@ -73,60 +73,40 @@
 		while ( (eChildNode = node.lastChild) )
 		{
-			switch ( eChildNode.nodeType )
-			{
-				case 1 :
-					if ( eChildNode.nodeName.toUpperCase() == 'BR' 
-							&& ( ignoreEndBRs || eChildNode.getAttribute( 'type', 2 ) == '_moz' ) )
-					{
-						// If node is a block node, then we need to find out whether there are more than
-						// one <br> tags at the end before deleting the <br> tags.
-						// To further complicate matters, there might be whitespaces between the final
-						// <br> tags, so simply checking previousSibling would not work.
-						var nodeTag = node.tagName.toLowerCase() ;
-						if ( FCKListsLib.BlockElements[nodeTag] || FCKListsLib.NonEmptyBlockElements[nodeTag] )
-						{
-							var previousNode = eChildNode.previousSibling ;
-							while ( previousNode && previousNode.nodeType == 3 && 
-									previousNode.nodeValue.search(  new RegExp("^[ \r\n\t]*$") == 0 ) )
-								previousNode = previousNode.previousSibling ;
-							if ( previousNode && previousNode.nodeType == 1 
-									&& previousNode.tagName.toLowerCase() == 'br' )
-							{
-								if ( eChildNode.getAttribute( 'type' ) == '_moz' )
-									eChildNode.removeAttribute( 'type' ) ;
-								break ;
-							}
-						}
-
-						// Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324).
-						eChildNode.parentNode.removeChild( eChildNode ) ;
-						continue ;
-					}
-					break ;
-
-				case 3 :
-					var sTrimmed = eChildNode.nodeValue.RTrim() ;
-					var iOriginalLength = eChildNode.nodeValue.length ;
-
-					if ( sTrimmed.length == 0 )
-					{
-						// If the trimmed text node is empty, just remove it.
-						
-						// Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#81).
-						eChildNode.parentNode.removeChild( eChildNode ) ;
-						continue ;
-					}
-					else if ( sTrimmed.length < iOriginalLength )
-					{
-						// If the trimmed text length is less than the original
-						// length, strip all spaces from the end by splitting
-						// the text and removing the resulting useless node.
-
-						eChildNode.splitText( sTrimmed.length ) ;
-						// Use "node.lastChild.parentNode" instead of "node" to avoid IE bug (#81).
-						node.lastChild.parentNode.removeChild( node.lastChild ) ;
-					}
+			if ( eChildNode.nodeType == 3 )
+			{
+				var sTrimmed = eChildNode.nodeValue.RTrim() ;
+				var iOriginalLength = eChildNode.nodeValue.length ;
+
+				if ( sTrimmed.length == 0 )
+				{
+					// If the trimmed text node is empty, just remove it.
+					
+					// Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#81).
+					eChildNode.parentNode.removeChild( eChildNode ) ;
+					continue ;
+				}
+				else if ( sTrimmed.length < iOriginalLength )
+				{
+					// If the trimmed text length is less than the original
+					// length, strip all spaces from the end by splitting
+					// the text and removing the resulting useless node.
+
+					eChildNode.splitText( sTrimmed.length ) ;
+					// Use "node.lastChild.parentNode" instead of "node" to avoid IE bug (#81).
+					node.lastChild.parentNode.removeChild( node.lastChild ) ;
+				}
 			}
 			break ;
+		}
+
+		if ( !FCKBrowserInfo.IsIE )
+		{
+			eChildNode = node.lastChild ;
+			
+			if ( eChildNode && eChildNode.nodeType == 1 && eChildNode.nodeName.toLowerCase() == 'br' )
+			{
+				// Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324).
+				eChildNode.parentNode.removeChild( eChildNode ) ;
+			}
 		}
 	},
Index: /FCKeditor/trunk/editor/_source/internals/fckxhtml.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 719)
+++ /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 720)
@@ -69,10 +69,4 @@
 	sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
 
-	// Remove the trailing <br> added by Gecko.
-	// REMOVE: Maybe the following is not anymore necessary because a similar
-	// check is made on _AppendNode
-	if ( FCKBrowserInfo.IsGecko )
-		sXHTML = sXHTML.replace( /<br\/>$/, '' ) ;
-
 	// Add a space in the tags with no closing tags, like <br/> -> <br />
 	sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
@@ -141,8 +135,17 @@
 	// BRs at the end of them.
 	if ( isBlockElement && htmlNode.tagName && htmlNode.tagName.toLowerCase() != 'pre' )
-		FCKDomTools.TrimNode( xmlNode, true ) ;
-
+	{
+		FCKDomTools.TrimNode( xmlNode ) ;
+
+		if ( FCKConfig.FillEmptyBlocks )
+		{
+			var lastChild = xmlNode.lastChild ;
+			if ( lastChild && lastChild.nodeType == 1 && lastChild.nodeName == 'br' )
+				this._AppendEntity( xmlNode, this._NbspEntity ) ;
+		}
+	}
+	
 	// If the resulting node is empty.
-	if ( xmlNode.childNodes.length == 0 ) 
+	if ( xmlNode.childNodes.length == 0 )
 	{
 		if ( isBlockElement && FCKConfig.FillEmptyBlocks )
@@ -223,8 +226,4 @@
 				return false ;
 
-			// Remove the <br> if it is a bogus node.
-			if ( sNodeName == 'br' && htmlNode.getAttribute( 'type', 2 ) == '_moz' )
-				return false ;
-
 			// The already processed nodes must be marked to avoid then to be duplicated (bad formatted HTML).
 			// So here, the "mark" is checked... if the element is Ok, then mark it.
