Ticket #1717: 1717.patch

File 1717.patch, 2.0 kB (added by fredck, 5 months ago)
  • _whatsnew.html

     
    7171                        is now enforced only when ForcePasteAsPlainText = true.</li> 
    7272                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1336">#1336</a>] Sometimes 
    7373                        the autogrow plugin didn't work properly in Firefox.</li> 
     74                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1717">#1717</a>] The editor 
     75                        was entering on looping on some specific cases when dealing with invalid source 
     76                        markup.</li> 
    7477        </ul> 
    7578        <p> 
    7679                <a href="_whatsnew_history.html">See previous versions history</a> 
  • editor/_source/classes/fckdomrangeiterator.js

     
    9292                var currentNode = this._NextNode ; 
    9393                var lastNode = this._LastNode ; 
    9494 
     95                this._NextNode = null ; 
     96 
    9597                while ( currentNode ) 
    9698                { 
    9799                        // closeRange indicates that a paragraph boundary has been found, 
     
    128130                                        // The range must finish right before the boundary, 
    129131                                        // including possibly skipped empty spaces. (#1603) 
    130132                                        if ( range ) 
     133                                        { 
    131134                                                range.SetEnd( currentNode, 3, true ) ; 
    132135 
     136                                                // The found boundary must be set as the next one at this 
     137                                                // point. (#1717) 
     138                                                if ( nodeName != 'br' )  
     139                                                        this._NextNode = currentNode ; 
     140                                        } 
     141 
    133142                                        closeRange = true ; 
    134143                                } 
    135144                                else 
     
    310319                // Get a reference for the next element. This is important because the 
    311320                // above block can be removed or changed, so we can rely on it for the 
    312321                // next interation. 
    313                 this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ; 
     322                if ( !this._NextNode ) 
     323                        this._NextNode = ( isLast || block == lastNode ) ? null : FCKDomTools.GetNextSourceNode( block, true, null, lastNode ) ; 
    314324 
    315325                return block ; 
    316326        }