Changeset 486

Show
Ignore:
Timestamp:
2007-07-20 12:33:46 (18 months ago)
Author:
fredck
Message:

Make the Safari fix for #963 more generic, so it is backwards compatible.

Files:
1 modified

Legend:

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

    r479 r486  
    2929{ 
    3030        FCKXHtmlEntities.Initialize() ; 
    31          
     31 
    3232        // Set the correct entity to use for empty blocks. 
    3333        this._NbspEntity = ( FCKConfig.ProcessHTMLEntities? 'nbsp' : '#160' ) ; 
     
    6161        this.XML = null ; 
    6262 
     63        // Safari adds xmlns="http://www.w3.org/1999/xhtml" to the root node (#963) 
     64        if ( FCKBrowserInfo.IsSafari ) 
     65                sXHTML = sXHTML.replace( /^<xhtml.*?>/, '<xhtml>' ) ; 
     66 
    6367        // Strip the "XHTML" root node. 
    64         // Workaround: Safari adds xmlns="http://www.w3.org/1999/xhtml" to the root node #963 
    65         if ( FCKBrowserInfo.IsSafari ) 
    66                 sXHTML = sXHTML.substr( 44, sXHTML.length - 52 ).Trim() ; 
    67         else 
    68                 sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ; 
     68        sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ; 
    6969 
    7070        // Remove the trailing <br> added by Gecko. 
     
    455455                if ( FCKBrowserInfo.IsGecko ) 
    456456                        sHtml = FCKTools.HTMLDecode( sHtml ); 
    457                  
     457 
    458458                // Remove the saved urls here as the data won't be processed as nodes 
    459459                sHtml = sHtml.replace( /\s_fcksavedurl="[^"]*"/g, '' ) ;