Ticket #2248: 2248.patch
File 2248.patch, 2.3 KB (added by , 17 years ago) |
---|
-
_whatsnew.html
106 106 are applied in the image preview dialog.</li> 107 107 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2056">#2056</a>] Fixed several validation 108 108 errors in the dialogs.</li> 109 <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 110 character.</li> 109 111 </ul> 110 112 <h3> 111 113 Version 2.6</h3> -
editor/_source/internals/fck_gecko.js
349 349 // selected content if any. 350 350 FCK.InsertHtml = function( html ) 351 351 { 352 var doc = FCK.EditorDocument ; 353 352 354 html = FCKConfig.ProtectedSource.Protect( html ) ; 353 355 html = FCK.ProtectEvents( html ) ; 354 356 html = FCK.ProtectUrls( html ) ; … … 357 359 // Save an undo snapshot first. 358 360 FCKUndo.SaveUndoStep() ; 359 361 362 if ( FCKBrowserInfo.IsGecko ) 363 { 364 // Using the following trick, 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 360 369 // 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 362 379 this.Focus() ; 363 380 364 381 // Save the caret position before calling document processor. … … 366 383 range.MoveToSelection() ; 367 384 var bookmark = range.CreateBookmark() ; 368 385 369 FCKDocumentProcessor.Process( FCK.EditorDocument) ;386 FCKDocumentProcessor.Process( doc ) ; 370 387 371 388 // Restore caret position, ignore any errors in case the document 372 389 // processor removed the bookmark <span>s for some reason.