Index: /FCKeditor/trunk/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 639)
+++ /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 640)
@@ -76,6 +76,27 @@
 			{
 				case 1 :
-					if ( eChildNode.nodeName.toUpperCase() == 'BR' && ( ignoreEndBRs || eChildNode.getAttribute( 'type', 2 ) == '_moz' ) )
+					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 ) ;
Index: /FCKeditor/trunk/editor/_source/internals/fckxhtml.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 639)
+++ /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 640)
@@ -144,5 +144,5 @@
 
 	// If the resulting node is empty.
-	if ( xmlNode.childNodes.length == 0 )
+	if ( xmlNode.childNodes.length == 0 ) 
 	{
 		if ( isBlockElement && FCKConfig.FillEmptyBlocks )
