Index: _source/plugins/clipboard/plugin.js
===================================================================
--- _source/plugins/clipboard/plugin.js (revision 5118)
+++ _source/plugins/clipboard/plugin.js (working copy)
@@ -184,7 +184,7 @@
var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : 'div', doc );
pastebin.setAttribute( 'id', 'cke_pastebin' );
// Safari requires a filler node inside the div to have the content pasted into it. (#4882)
- CKEDITOR.env.webkit && pastebin.append( doc.createText( '\xa0' ) );
+ CKEDITOR.env.webkit && pastebin.append( CKEDITOR.dom.element.createFromHtml( '
\xa0
' ) );
doc.getBody().append( pastebin );
// It's definitely a better user experience if we make the paste-bin pretty unnoticed
@@ -237,12 +237,13 @@
pastebin.remove();
// Grab the HTML contents.
- // We need to look for a apple style wrapper on webkit it also adds
+ // In WebKit we always add an empty div inside the pastebin.
+ // After that, we need to look for an apple style wrapper on webkit it also adds
// a div wrapper if you copy/paste the body of the editor.
// Remove hidden div and restore selection.
var bogusSpan;
- pastebin = ( CKEDITOR.env.webkit
- && ( bogusSpan = pastebin.getFirst() )
+ CKEDITOR.env.webkit && ( pastebin = pastebin.getFirst() )
+ && ( pastebin = ( bogusSpan = pastebin.getFirst() )
&& ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ?
bogusSpan : pastebin );