You are 100% right. This is still true with FCKEditor 2.6 (all comments are relative to the 2.6 codebase)
If you make the code <a href="bob"></a> FCKeditor will eat it at it's first opportunity. Since this is perfectly valid code I'm pretty sure this was an introduced bug while trying to fix SF-BUG 1556878. They tried to fix the outcome not the cause and then removed perfectly valid xhtml in the process.
The easiest way to reproduce this is as follows:
1. Start an FCKEditor. 2. Go to source mode (in FCKEditor) 3. Type in <a href="bob"></a> (note nothing in the contents area of the anchor) 4. Go to WYSIWYG mode. 5. Go back to source mode.
You'll find that your typing has vanished.
Here's the fix. The source file is editor/_source/internals/fckxhtml.js in function FCKXHtml.TagProcessors .
If you remove the following lines the "expected" behavior returns.
// Firefox may create empty tags when deleting the selection in some special cases (SF-BUG 1556878).
if ( htmlNode.innerHTML.Trim().length == 0 && !htmlNode.name )
return false ;
The real code that gets run is editor/js/fckeditorcode_gecko.js and editor/js/fckeditorcode_ie.js .
It's a little tricky to edit this because the lines are huge. Remove the following text from both files and you'll be golden:
if (B.innerHTML.Trim().length==0&&!B.name) return false;
I suggest this code somehow makes it into the codebase as a fix. I have no idea where to submit it.
Re: FCK editor anchor links not working! Please help!
Test2
#Test2
Re: FCK editor anchor links not working! Please help!
Re: FCK editor anchor links not working! Please help!
FIXED: FCK empty anchor tags being removed.
If you make the code <a href="bob"></a> FCKeditor will eat it at it's first opportunity. Since this is perfectly valid code I'm pretty sure this was an introduced bug while trying to fix SF-BUG 1556878. They tried to fix the outcome not the cause and then removed perfectly valid xhtml in the process.
The easiest way to reproduce this is as follows:
1. Start an FCKEditor.
2. Go to source mode (in FCKEditor)
3. Type in <a href="bob"></a> (note nothing in the contents area of the anchor)
4. Go to WYSIWYG mode.
5. Go back to source mode.
You'll find that your typing has vanished.
Here's the fix. The source file is editor/_source/internals/fckxhtml.js in function FCKXHtml.TagProcessors .
If you remove the following lines the "expected" behavior returns.
The real code that gets run is editor/js/fckeditorcode_gecko.js and editor/js/fckeditorcode_ie.js .
It's a little tricky to edit this because the lines are huge. Remove the following text from both files and you'll be golden:
I suggest this code somehow makes it into the codebase as a fix. I have no idea where to submit it.
--
Jeffrey Hundstad