Changeset 1090

Show
Ignore:
Timestamp:
2007-11-19 09:41:48 (9 months ago)
Author:
martinkou
Message:

Fixed #1518 : Fixed the issue where creating lists can sometimes leave an excessive BR node on the previous paragraph.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckdomrangeiterator.js

    r991 r1090  
    266266                                        removePreviousBr = !splitInfo.WasStartOfBlock ; 
    267267                                        removeLastBr = !splitInfo.WasEndOfBlock ; 
     268                                        FCKDebug.Output( 'removePreviousBr=' + removePreviousBr + ',removeLastBr=' + removeLastBr ) ; 
    268269 
    269270                                        // Insert the new block into the DOM. 
     
    286287                { 
    287288                        var previousSibling = block.previousSibling ; 
    288                         if ( previousSibling && previousSibling.nodeType == 1 && previousSibling.nodeName.toLowerCase() == 'br' ) 
    289                                 previousSibling.parentNode.removeChild( previousSibling ) ; 
     289                        if ( previousSibling && previousSibling.nodeType == 1 ) 
     290                        { 
     291                                if ( previousSibling.nodeName.toLowerCase() == 'br' ) 
     292                                        previousSibling.parentNode.removeChild( previousSibling ) ; 
     293                                else if ( previousSibling.lastChild && previousSibling.lastChild.nodeName.IEquals( 'br' ) ) 
     294                                        previousSibling.removeChild( previousSibling.lastChild ) ; 
     295                        } 
    290296                } 
    291297