Index: /FCKeditor/branches/features/anchors/_whatsnew.html
===================================================================
--- /FCKeditor/branches/features/anchors/_whatsnew.html	(revision 25)
+++ /FCKeditor/branches/features/anchors/_whatsnew.html	(revision 26)
@@ -55,5 +55,15 @@
 			PATCH-1456343</a>] New sample file showing how to dinamically exchange a textarea and an instance of FCKeditor. 
 			Thanks to Finn Hakansson</li>
-	</ul>
+		<li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1496115&group_id=75348&atid=543655">SF
+			PATCH-1496115</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1588578&group_id=75348&atid=543653">SF
+			BUG-1588578</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1376534&group_id=75348&atid=543655">SF
+			BUG-1376534</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1343506&group_id=75348&atid=543655">SF
+			BUG-1343506</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1211065&group_id=75348&atid=543656">SF
+			Feature-1211065</a>] [<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=949144&group_id=75348&atid=543656">SF
+			Feature-949144</a>] The content of anchors are shown and preserved on creation. * </li>
+		<li>[<a target="_blank" href="https://sourceforge.net/tracker/index.php?func=detail&aid=1587175&group_id=75348&atid=543656">SF
+			Feature-1587175</a>] Local links to an anchor are readjusted if the anchor changes.</li>
+	</ul>
+
 	<p>
 		Fixed Bugs:</p>
@@ -134,4 +144,6 @@
 		<li>[<a target="_blank" href="https://sourceforge.net/tracker/?func=detail&atid=543653&aid=1610790&group_id=75348">SF BUG-1610790</a>] On some specific situations, the call to form.submit(), in form were FCKeditor has
 			been unloaded by code, was throwing the "Can't execute code from a freed script" error.</li></ul>
+	<p>
+		* This version has been partially sponsored by <a href="http://www.imedi.org/">Medical Media Lab</a>.</p>
 	<h3>
 		Version 2.3.2</h3>
Index: /FCKeditor/branches/features/anchors/editor/_source/internals/fckregexlib.js
===================================================================
--- /FCKeditor/branches/features/anchors/editor/_source/internals/fckregexlib.js	(revision 25)
+++ /FCKeditor/branches/features/anchors/editor/_source/internals/fckregexlib.js	(revision 26)
@@ -38,5 +38,5 @@
 
 // Temporary classes (Tables without border, Anchors with content) used in IE
-FCK_Class		: /\s*FCK__[A-Za-z]*\s*/ ,
+FCK_Class		: /(\s*FCK__[A-Za-z]*\s*)/ ,
 
 // Validate element names (it must be in lowercase).
Index: /FCKeditor/branches/features/anchors/editor/dialog/fck_anchor.html
===================================================================
--- /FCKeditor/branches/features/anchors/editor/dialog/fck_anchor.html	(revision 25)
+++ /FCKeditor/branches/features/anchors/editor/dialog/fck_anchor.html	(revision 26)
@@ -19,4 +19,6 @@
 var FCK		= oEditor.FCK ;
 var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
+var FCKTools = oEditor.FCKTools ;
+var FCKRegexLib = oEditor.FCKRegexLib ;
 
 // Gets the document DOM
@@ -57,6 +59,15 @@
 function Ok()
 {
-	if ( GetE('txtName').value.length == 0 )
-	{
+	var sNewName = GetE('txtName').value ;
+
+	if ( sNewName.length == 0 )
+	{
+		// Remove the anchor if the user leaves the name blank
+		if ( oAnchor )	
+		{
+			RemoveAnchor() ;
+			return true ;
+		}
+
 		alert( oEditor.FCKLang.DlgAnchorErrorName ) ;
 		return false ;
@@ -67,4 +78,6 @@
 	if ( oAnchor )	// Modifying an existent anchor.
 	{
+		ReadjustLinksToAnchor( oAnchor.name, sNewName );
+
 		// Buggy explorer, bad bad browser. http://alt-tag.com/blog/archives/2006/02/ie-dom-bugs/
 		// Instead of just replacing the .name for the existing anchor (in order to preserve the content), we must remove the .name
@@ -74,5 +87,5 @@
 		oAnchor.removeAttribute( 'name' ) ;
 		// Now we set it, but later we must process it specially
-		oAnchor.name = GetE( 'txtName' ).value ;
+		oAnchor.name = sNewName ;
 
 		return true ;
@@ -92,5 +105,5 @@
 	}
 	// Set the name
-	oAnchor.name = GetE( 'txtName' ).value ;
+	oAnchor.name = sNewName ;
 
 	// IE does require special processing to show the Anchor's image
@@ -105,4 +118,5 @@
 		else
 		{
+			// Create a fake image for both IE and Opera
 			var oImg = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oAnchor.cloneNode(true) ) ;
 			oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
@@ -115,4 +129,62 @@
 
 	return true ;
+}
+
+// Removes the current anchor from the document
+function RemoveAnchor()
+{
+	// If it's also a link, then just remove the name and exit
+	if ( oAnchor.href.length != 0 )
+	{
+		oAnchor.removeAttribute( 'name' ) ;
+		// Remove temporary class for IE
+		if ( FCKBrowserInfo.IsIE )
+			oAnchor.className = oAnchor.className.replace( FCKRegexLib.FCK_Class, '' ) ;
+		return ;
+	}
+
+	// We need to remove the anchor
+	// If we got a fake image, then just remove it and we're done
+	if ( oFakeImage )
+	{
+		oFakeImage.parentNode.removeChild( oFakeImage ) ;
+		return ;
+	}
+	// Empty anchor, so just remove it
+	if ( oAnchor.innerHTML.length == 0 )
+	{
+		oAnchor.parentNode.removeChild( oAnchor ) ;
+		return ;
+	}
+	// Anchor with content, leave the content
+	FCKTools.RemoveOuterTags( oAnchor ) ;
+}
+
+// Checks all the links in the current page pointing to the current name and changes them to the new name
+function ReadjustLinksToAnchor( sCurrent, sNew )
+{
+	var oDoc = FCK.EditorDocument ;
+	
+	var aLinks = oDoc.getElementsByTagName( 'A' ) ;
+
+	var sReference = '#' + sCurrent ;
+	// The url of the document, so we check absolute and partial references.
+	var sFullReference = oDoc.location.href.replace( /(#.*$)/, '') ;
+	sFullReference += sReference ;
+
+	var oLink ;
+	var i = aLinks.length - 1 ;
+	while ( i >= 0 && ( oLink = aLinks[i--] ) )
+	{
+		var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
+		if ( sHRef == null )
+			sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
+
+		if ( sHRef == sReference || sHRef == sFullReference )
+		{
+			oLink.href = '#' + sNew ;
+			SetAttribute( oLink, '_fcksavedurl', '#' + sNew ) ;
+		}
+	}
 }
 
