Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 2096)
+++ _whatsnew.html (working copy)
@@ -61,6 +61,13 @@
for those who wish to force the #183 fix to be enabled.
[#2276] [#2279] On Opera
and Firefox 3, the entire page was scrolling on ENTER.
+ [#2287] On some
+ specific cases, with Firefox 2, some extra spacing was appearing in the final HTML
+ on posting, if inserting two successive tables.
+ [#2287] 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.
Index: editor/_source/classes/fckdomrange.js
===================================================================
--- editor/_source/classes/fckdomrange.js (revision 2096)
+++ editor/_source/classes/fckdomrange.js (working copy)
@@ -868,6 +868,12 @@
this.ExtractContents().AppendTo( oFixedBlock ) ;
FCKDomTools.TrimNode( oFixedBlock ) ;
+ // If the fixed block is empty (not counting bookmark nodes)
+ // Add a
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: editor/_source/internals/fck.js
===================================================================
--- editor/_source/internals/fck.js (revision 2096)
+++ editor/_source/internals/fck.js (working copy)
@@ -673,9 +673,22 @@
// object that may internally supply this feature.
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 ) ;
var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ;
@@ -705,9 +718,7 @@
}
else
{
- // Delete the current selection and insert the node.
- range.MoveToSelection() ;
- range.DeleteContents() ;
+ // Insert the node.
range.InsertNode( element ) ;
// Move the selection right after the new element.