diff -Naur ckeditor-trunk/_source/plugins/clipboard/plugin.js ckeditor-trunk-modified/_source/plugins/clipboard/plugin.js
old
|
new
|
|
292 | 292 | editor.on( 'paste', function( evt ) |
293 | 293 | { |
294 | 294 | var data = evt.data; |
295 | | if ( data[ 'html' ] ) |
| 295 | if ( data[ 'html' ] ) { |
| 296 | if (CKEDITOR.env.gecko) { |
| 297 | //Gecko will modify the src attribute in images to be relative when you cut and paste: fix this if the image is pasted from within ckeditor |
| 298 | var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data[ 'html' ] ), |
| 299 | writer = new CKEDITOR.htmlParser.basicWriter(); |
| 300 | var htmlFilter = new CKEDITOR.htmlParser.filter(); |
| 301 | htmlFilter.addRules( { |
| 302 | elements : |
| 303 | { |
| 304 | img : function(element) { |
| 305 | if (element.attributes._cke_saved_src) element.attributes.src = element.attributes._cke_saved_src; |
| 306 | } |
| 307 | } |
| 308 | } ); |
| 309 | |
| 310 | fragment.writeHtml( writer, htmlFilter ); |
| 311 | data[ 'html' ] = writer.getHtml( true ); |
| 312 | } |
296 | 313 | editor.insertHtml( data[ 'html' ] ); |
| 314 | } |
297 | 315 | else if ( data[ 'text' ] ) |
298 | 316 | editor.insertText( data[ 'text' ] ); |
299 | 317 | |