Changeset 217

Show
Ignore:
Timestamp:
2007-03-16 17:49:45 (22 months ago)
Author:
fredck
Message:

Fixed #254 : The IgnoreEmptyParagraphValue setting is now correctly handled in Firefox.
Also, some lines have been moved to their right place.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

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

    r210 r217  
    8989                this.EditingArea = new FCKEditingArea( document.getElementById( 'xEditingArea' ) ) ; 
    9090                this.EditingArea.FFSpellChecker = false ; 
    91                  
     91 
    9292                // Final setup of the lists lib. 
    9393                FCKListsLib.Setup() ; 
     
    207207 
    208208                if ( FCKConfig.FullPage ) 
     209                { 
    209210                        sXHTML = FCKXHtml.GetXHTML( oDoc.getElementsByTagName( 'html' )[0], true, format ) ; 
     211 
     212                        if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 ) 
     213                                sXHTML = FCK.DocTypeDeclaration + '\n' + sXHTML ; 
     214 
     215                        if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) 
     216                                sXHTML = FCK.XmlDeclaration + '\n' + sXHTML ; 
     217                } 
    210218                else 
    211219                { 
    212                         if ( FCKConfig.IgnoreEmptyParagraphValue && oDoc.body.innerHTML == '<P>&nbsp;</P>' ) 
     220                        sXHTML = FCKXHtml.GetXHTML( oDoc.body, false, format ) ; 
     221 
     222                        if ( FCKConfig.IgnoreEmptyParagraphValue && FCKRegexLib.EmptyOutParagraph.test( sXHTML ) ) 
    213223                                sXHTML = '' ; 
    214                         else 
    215                                 sXHTML = FCKXHtml.GetXHTML( oDoc.body, false, format ) ; 
    216224                } 
    217225 
     
    221229                if ( FCKBrowserInfo.IsIE ) 
    222230                        sXHTML = sXHTML.replace( FCKRegexLib.ToReplace, '$1' ) ; 
    223  
    224                 if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 ) 
    225                         sXHTML = FCK.DocTypeDeclaration + '\n' + sXHTML ; 
    226  
    227                 if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) 
    228                         sXHTML = FCK.XmlDeclaration + '\n' + sXHTML ; 
    229231 
    230232                return FCKConfig.ProtectedSource.Revert( sXHTML ) ; 
     
    315317                { 
    316318                        html = FCKConfig.ProtectedSource.Protect( html ) ; 
    317                          
     319 
    318320                        // Fix for invalid self-closing tags (see #152). 
    319321                        html = html.replace( FCKRegexLib.InvalidSelfCloseTags, '$1></$2>' ) ; 
    320                          
     322 
    321323                        html = FCK.ProtectEvents( html ) ; 
    322324                        html = FCK.ProtectUrls( html ) ; 
     
    332334                                html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ; 
    333335                        } 
    334                          
     336 
    335337                        this._ForceResetIsDirty = ( resetIsDirty === true ) ; 
    336338 
     
    430432                        // Removes the enter key handler. 
    431433                        FCK.EnterKeyHandler = null ; 
    432                          
     434 
    433435                        if ( resetIsDirty ) 
    434436                                this.ResetIsDirty() ; 
     
    570572 
    571573                FCK.SetHTML( sHtml, !bIsDirty ) ; 
    572                  
     574 
    573575                // Set the Focus. 
    574576                FCK.Focus() ; 
     
    644646        // Listen for keystroke events. 
    645647        FCK.KeystrokeHandler.AttachToElement( FCK.EditorDocument ) ; 
    646          
     648 
    647649        if ( FCK._ForceResetIsDirty ) 
    648650                FCK.ResetIsDirty() ; 
    649          
     651 
    650652        // This is a tricky thing for IE. In some cases, even if the cursor is 
    651653        // blinking in the editing, the keystroke handler doesn't catch keyboard 
  • FCKeditor/trunk/editor/_source/internals/fckregexlib.js

    r210 r217  
    6060 
    6161// Empty elements may be <p></p> or even a simple opening <p> (see #211). 
    62 EmptyParagraph  : /^<([^ >]+)[^>]*>\s*(<\/\1>)?$/i , 
     62EmptyParagraph  : /^<([^ >]+)[^>]*>\s*(<\/\1>)?$/ , 
     63 
     64EmptyOutParagraph : /^<([^ >]+)[^>]*>(?:\s*|&nbsp;)(<\/\1>)?$/ , 
    6365 
    6466TagBody                 : /></ , 
  • FCKeditor/trunk/_whatsnew.html

    r214 r217  
    117117                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/190">#190</a>] Toolbars 
    118118                        may be wrongly positioned. Fixed.</li> 
     119                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/254">#254</a>] The IgnoreEmptyParagraphValue 
     120                        setting is now correctly handled in Firefox.</li> 
    119121        </ul> 
    120122        <h3>