Index: /FCKeditor/trunk/_whatsnew.html =================================================================== --- /FCKeditor/trunk/_whatsnew.html (revision 3887) +++ /FCKeditor/trunk/_whatsnew.html (revision 3888) @@ -74,4 +74,6 @@
Index: /FCKeditor/trunk/editor/_source/internals/fck_gecko.js =================================================================== --- /FCKeditor/trunk/editor/_source/internals/fck_gecko.js (revision 3887) +++ /FCKeditor/trunk/editor/_source/internals/fck_gecko.js (revision 3888) @@ -376,4 +376,14 @@ range = new FCKDomRange( this.EditorWindow ) ; range.MoveToSelection() ; + + // If the first element (if exists) of the document fragment is a block + // element, then split the current block. (#1537) + var currentNode = docFrag.RootNode.firstChild ; + while ( currentNode && currentNode.nodeType != 1 ) + currentNode = currentNode.nextSibling ; + + if ( currentNode && FCKListsLib.BlockElements[ currentNode.nodeName.toLowerCase() ] ) + range.SplitBlock() ; + range.DeleteContents() ; range.InsertNode( docFrag.RootNode ) ; Index: /FCKeditor/trunk/editor/_source/internals/fck_ie.js =================================================================== --- /FCKeditor/trunk/editor/_source/internals/fck_ie.js (revision 3887) +++ /FCKeditor/trunk/editor/_source/internals/fck_ie.js (revision 3888) @@ -173,5 +173,10 @@ // Remove the fake node - FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode( true ) ; + var fake = FCK.EditorDocument.getElementById('__fakeFCKRemove__') ; + // If the span is the only child of a node (so the inserted HTML is beyond that), + // remove also that parent that isn't needed. #1537 + if (fake.parentNode.childNodes.length == 1) + fake = fake.parentNode ; + fake.removeNode( true ) ; FCKDocumentProcessor.Process( FCK.EditorDocument ) ;