Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 2317)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 2318)
@@ -63,4 +63,6 @@
 			where spelling mistake corrections made by the spell checking dialog are not undoable.
 			</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2411">#2411</a>] Fixed the issue
+			where insert anchor no longer works for non-empty selections.</li>
 	</ul>
 	<h3>
Index: /FCKeditor/trunk/editor/dialog/fck_anchor.html
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_anchor.html	(revision 2317)
+++ /FCKeditor/trunk/editor/dialog/fck_anchor.html	(revision 2318)
@@ -120,15 +120,5 @@
 
 	if ( aNewAnchors.length == 0 )
-	{
-		// Nothing was selected, so now just create a normal A
-		if ( FCKBrowserInfo.IsIE )
-			aNewAnchors.push( oEditor.FCK.InsertElement( '<a name="' + FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ) ;
-		else
-		{
-			var n = oEditor.FCK.InsertElement( 'a' ) ;
-			n.name = sNewName ;
-			aNewAnchors.push( n ) ;
-		}
-	}
+			aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
 	else
 	{
@@ -142,4 +132,18 @@
 	{
 		oAnchor = aNewAnchors[i] ;
+
+		// Set the name
+		if ( FCKBrowserInfo.IsIE )
+		{
+			// Setting anchor names directly in IE will trash the HTML code stored
+			// in FCKTempBin after undos. See #2263.
+			var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
+					FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
+			oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
+			oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
+			oAnchor = replaceAnchor ;
+		}
+		else
+			oAnchor.name = sNewName ;
 
 		// IE does require special processing to show the Anchor's image
