#2253: [FIXED] Empty anchor tags being removed.
-------------------+--------------------------------------------------------
 Reporter:  j3gum  |        Type:  Bug    
   Status:  new    |    Priority:  Normal 
Milestone:         |   Component:  General
  Version:         |    Keywords:         
-------------------+--------------------------------------------------------
 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.[[BR]]
 2. Go to source mode (in FCKEditor)[[BR]]
 3. Type in <a href="bob"></a>   (note nothing in the contents area of the
 anchor)[[BR]]
 4. Go to WYSIWYG mode.[[BR]]
 5. Go back to source mode.[[BR]]

 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.

 -- [[BR]]

 Jeffrey Hundstad

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/2253>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to