Changeset 1388

Show
Ignore:
Timestamp:
2008-01-23 03:15:14 (9 months ago)
Author:
martinkou
Message:

Fixed #503 : Fixed orphaned <li> elements after pasting unordered list items in IE.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1282 r1388  
    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 ) 
     
    11601162 
    11611163 
     1164 
  • FCKeditor/trunk/editor/_source/internals/fckxhtml.js

    r1282 r1388  
    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 ) 
  • FCKeditor/trunk/_whatsnew.html

    r1387 r1388  
    5656                        are now being properly shown in Firefox Mac when placing FCKeditor inside a hidden 
    5757                        div.</li> 
     58                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/503">#503</a>] Orphaned 
     59                        &lt;li&gt; elements now get properly enclosed in a &lt;ul&gt; on output.</li> 
    5860        </ul> 
    5961        <p>