Index: FCKeditor/trunk/_whatsnew.html
===================================================================
--- FCKeditor/trunk/_whatsnew.html	(revision 2097)
+++ FCKeditor/trunk/_whatsnew.html	(revision 2106)
@@ -65,4 +65,11 @@
 			with querystring parameters were not being accepted for CSS values in the configuration
 			file (like EditorAreaCSS).</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] On some
+			specific cases, with Firefox 2, some extra spacing was appearing in the final HTML
+			on posting, if inserting two successive tables.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] Block
+			elements (like tables or horizontal rules) will be inserted correctly now when the
+			cursor is at the start or the end of blocks. No extra paragraphs will be included
+			in this operation.</li>
 	</ul>
 	<p>
Index: FCKeditor/trunk/editor/_source/classes/fckdomrange.js
===================================================================
--- FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 2097)
+++ FCKeditor/trunk/editor/_source/classes/fckdomrange.js	(revision 2106)
@@ -869,4 +869,10 @@
 		FCKDomTools.TrimNode( oFixedBlock ) ;
 
+		// If the fixed block is empty (not counting bookmark nodes)
+		// Add a <br /> inside to expand it.
+		if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
+				&& FCKBrowserInfo.IsGeckoLike )
+				FCKTools.AppendBogusBr( oFixedBlock ) ;
+
 		// Insert the fixed block into the DOM.
 		this.InsertNode( oFixedBlock ) ;
Index: FCKeditor/trunk/editor/_source/internals/fck.js
===================================================================
--- FCKeditor/trunk/editor/_source/internals/fck.js	(revision 2097)
+++ FCKeditor/trunk/editor/_source/internals/fck.js	(revision 2106)
@@ -674,7 +674,20 @@
 		var range = new FCKDomRange( this.EditorWindow ) ;
 
+		// Move to the selection and delete it.
+		range.MoveToSelection() ;
+		range.DeleteContents() ;
+
 		if ( FCKListsLib.BlockElements[ elementName ] != null )
 		{
-			range.SplitBlock() ;
+			if ( range.StartBlock )
+			{
+				if ( range.CheckStartOfBlock() )
+					range.MoveToPosition( range.StartBlock, 3 ) ;
+				else if ( range.CheckEndOfBlock() )
+					range.MoveToPosition( range.StartBlock, 4 ) ;
+				else
+					range.SplitBlock() ;
+			}
+
 			range.InsertNode( element ) ;
 
@@ -706,7 +719,5 @@
 		else
 		{
-			// Delete the current selection and insert the node.
-			range.MoveToSelection() ;
-			range.DeleteContents() ;
+			// Insert the node.
 			range.InsertNode( element ) ;
 
