Ticket #503: 503_2.patch

File 503_2.patch, 3.3 KB (added by fredck, 2 years ago)
  • _whatsnew.html

     
    4747                        several "strict warning" messages in Firefox when running FCKeditor.</li> 
    4848                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1522">#1522</a>] The ENTER 
    4949                        key will now work properly in IE with the cursor at the start of a formatted block.</li> 
    50                 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's possible 
    51                         to define in the Styles that a Style (with an empty class) must be shown selected 
    52                         only when no class is present in the current element, and selecting that item will  
    53                         clear the current class (it does apply to any attribute, not only classes).</li> 
    54  
     50                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1503">#1503</a>] It's 
     51                        possible to define in the Styles that a Style (with an empty class) must be shown 
     52                        selected only when no class is present in the current element, and selecting that 
     53                        item will clear the current class (it does apply to any attribute, not only classes).</li> 
     54                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned 
     55                        &lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li> 
    5556        </ul> 
    5657        <p> 
    5758                <a href="_whatsnew_history.html">See previous versions history</a> 
  • editor/_source/internals/fck.js

     
    176176                        { 
    177177                                // Element Node. 
    178178                                case 1 : 
    179                                         if ( !FCKListsLib.BlockElements[ oNode.nodeName.toLowerCase() ] &&  
     179                                        var nodeName = oNode.nodeName.toLowerCase() ; 
     180                                        if ( !FCKListsLib.BlockElements[ nodeName ] &&  
     181                                                        nodeName != 'li' && 
    180182                                                        !oNode.getAttribute('_fckfakelement') && 
    181183                                                        oNode.getAttribute('_moz_dirty') == null ) 
    182184                                                bMoveNode = true ; 
  • editor/_source/internals/fckxhtml.js

     
    403403                return node ; 
    404404        }, 
    405405 
     406        // Fix orphaned <li> nodes (Bug #503). 
     407        li : function( node, htmlNode, targetNode ) 
     408        { 
     409                // If the XML parent node is already a <ul> or <ol>, then add the <li> as usual. 
     410                if ( targetNode.nodeName.IEquals( ['ul', 'ol'] ) ) 
     411                        return FCKXHtml._AppendChildNodes( node, htmlNode, true ) ; 
     412 
     413                var newTarget = FCKXHtml.XML.createElement( 'ul' ) ; 
     414 
     415                // Reset the _fckxhtmljob so the HTML node is processed again. 
     416                htmlNode._fckxhtmljob = null ;  
     417 
     418                // Loop through all sibling LIs, adding them to the <ul>. 
     419                do 
     420                { 
     421                        FCKXHtml._AppendNode( newTarget, htmlNode ) ; 
     422                         
     423                        // Look for the next element following this <li>. 
     424                        do 
     425                        { 
     426                                htmlNode = FCKDomTools.GetNextSibling( htmlNode ) ; 
     427                        } 
     428                        while ( htmlNode && htmlNode.nodeType == 3 && htmlNode.nodeValue.Trim().length == 0 ) 
     429                } 
     430                while ( htmlNode && htmlNode.nodeName.toLowerCase() == 'li' ) 
     431 
     432                return newTarget ; 
     433        }, 
     434 
    406435        // Fix nested <ul> and <ol>. 
    407436        ol : function( node, htmlNode, targetNode ) 
    408437        {