I've always had problems trying to insert some text
replacing the selection with IE, the text many times
didn't get inserted in exactly the place of the
selection, but just at the place where the next
character started (inside that new node, so the
insertion became nested where it shouldn't)
Just today I seem to have found a fix for that, in
FCK.InsertHtml get a reference to the range before it
is cleared and so the caret doesn't move when you
latter paste the new html in.
Although in my tests the call to oSel.clear() ; isn't
neccesary so the fix could also be to remove those two
lines.
FCK.InsertHtml = function( html )
{
FCK.Focus() ;
FCKUndo.SaveUndoStep() ;
// Gets the actual selection.
var oSel = FCK.EditorDocument.selection ;
//Alfonso-> get the range before clearing it
var oRange=oSel.createRange();
// Deletes the actual selection contents.
if ( oSel.type.toLowerCase() != "none" )
oSel.clear() ;
//Alfonso->reuse the saved range
// Insert the HTML.
oRange.pasteHTML( html ) ;
}