Ticket #1603: 1603.patch

File 1603.patch, 2.6 KB (added by fredck, 2 years ago)
  • _whatsnew.html

     
    5757                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/339">#339</a>] [<a 
    5858                        target="_blank" href="http://dev.fckeditor.net/ticket/681">#681</a>] The SpellerPages 
    5959                        spell checker will now completely ignore the presence of HTML tags in the text.</li> 
     60                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1603">#1603</a>] Certain 
     61                        specific markup was making FCKeditor entering in a loop, blocking its execution.</li> 
    6062        </ul> 
    6163        <p> 
    6264                <a href="_whatsnew_history.html">See previous versions history</a> 
  • editor/_source/classes/fckdomrangeiterator.js

     
    125125                                                break ; 
    126126                                        } 
    127127 
     128                                        // The range must finish right before the boundary, 
     129                                        // including possibly skipped empty spaces. (#1603) 
     130                                        if ( range ) 
     131                                                range.SetEnd( currentNode, 3, true ) ; 
     132 
    128133                                        closeRange = true ; 
    129134                                } 
    130135                                else 
     
    181186                                        } 
    182187 
    183188                                        currentNode = parentNode ; 
     189                                        includeNode = true ; 
    184190                                        isLast = ( currentNode == lastNode ) ; 
    185191                                        continueFromSibling = true ; 
    186192                                } 
  • editor/_source/classes/fckelementpath.js

     
    4646 
    4747                                if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null ) 
    4848                                { 
    49                                         // DIV is considered the Block, if no block is available (#525). 
    50                                         if ( !eBlock && sElementName == 'div' ) 
     49                                        // DIV is considered the Block, if no block is available (#525) 
     50                                        // and if it doesn't contain other blocks. 
     51                                        if ( !eBlock && sElementName == 'div' && !FCKElementPath._CheckHasBlock( e ) ) 
    5152                                                eBlock = e ; 
    5253                                        else 
    5354                                                eBlockLimit = e ; 
     
    6768        this.Elements = aElements ; 
    6869} 
    6970 
    70  
     71/** 
     72 * Check if an element contains any block element. 
     73 */ 
     74FCKElementPath._CheckHasBlock = function( element ) 
     75{ 
     76        var childNodes = element.childNodes ; 
     77         
     78        for ( var i = 0, count = childNodes.length ; i < count ; i++ ) 
     79        { 
     80                var child = childNodes[i] ; 
     81                 
     82                if ( child.nodeType == 1 && FCKListsLib.BlockElements[ child.nodeName.toLowerCase() ] ) 
     83                        return true ; 
     84        } 
     85         
     86        return false ; 
     87} 
     88 No newline at end of file