Changeset 2070 for FCKeditor/trunk


Ignore:
Timestamp:
06/13/2008 09:25:00 AM (6 years ago)
Author:
fredck
Message:

Fixed #2248 : Calling FCK.InsertHtml( 'nbsp;') was inserting a plain space instead of a non breaking space character.

Location:
FCKeditor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/_whatsnew.html

    r2069 r2070  
    4545                Fixed Bugs:</p> 
    4646        <ul> 
    47                 <li></li> 
     47                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2248">#2248</a>] Calling FCK.InsertHtml( 'nbsp;') was inserting a plain space instead of a non breaking space 
     48                        character.</li> 
    4849        </ul> 
    4950        <p> 
  • FCKeditor/trunk/editor/_source/internals/fck_gecko.js

    r2054 r2070  
    350350FCK.InsertHtml = function( html ) 
    351351{ 
     352        var doc = FCK.EditorDocument ; 
     353 
    352354        html = FCKConfig.ProtectedSource.Protect( html ) ; 
    353355        html = FCK.ProtectEvents( html ) ; 
     
    358360        FCKUndo.SaveUndoStep() ; 
    359361 
     362        if ( FCKBrowserInfo.IsGecko ) 
     363        { 
     364                // Using the following trick, &nbsp; present at the beginning and at 
     365                // the end of the HTML are preserved (#2248). 
     366                html = '<span id="__fakeFCKRemove1__" style="display:none;">fakeFCKRemove</span>' + html + '<span id="__fakeFCKRemove2__" style="display:none;">fakeFCKRemove</span>' ; 
     367        } 
     368 
    360369        // Insert the HTML code. 
    361         this.EditorDocument.execCommand( 'inserthtml', false, html ) ; 
     370        doc.execCommand( 'inserthtml', false, html ) ; 
     371 
     372        if ( FCKBrowserInfo.IsGecko ) 
     373        { 
     374                // Remove the fake nodes. 
     375                FCKDomTools.RemoveNode( doc.getElementById('__fakeFCKRemove1__') ) ; 
     376                FCKDomTools.RemoveNode( doc.getElementById('__fakeFCKRemove2__') ) ; 
     377        } 
     378 
    362379        this.Focus() ; 
    363380 
     
    367384        var bookmark = range.CreateBookmark() ; 
    368385 
    369         FCKDocumentProcessor.Process( FCK.EditorDocument ) ; 
     386        FCKDocumentProcessor.Process( doc ) ; 
    370387 
    371388        // Restore caret position, ignore any errors in case the document 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy