Skip to content
Permalink
Browse files

Merge branch 't/9534'

  • Loading branch information
Reinmar committed Nov 7, 2012
2 parents 47064ec + 7a786a7 commit 3cbf8afb5444df90a312818a944b60d404e8110b
Showing with 12 additions and 1 deletion.
  1. +12 −1 plugins/clipboard/plugin.js
@@ -93,11 +93,11 @@

CKEDITOR.dialog.add( 'paste', CKEDITOR.getUrl( this.path + 'dialogs/paste.js' ) );

// Filter webkit garbage.
editor.on( 'paste', function( evt ) {
var data = evt.data.dataValue,
blockElements = CKEDITOR.dtd.$block;

// Filter webkit garbage.
if ( data.indexOf( 'Apple-' ) > -1 ) {
// Replace special webkit's   with simple space, because webkit
// produces them even for normal spaces.
@@ -123,6 +123,17 @@
data = data.replace( /(<[^>]+) class="Apple-[^"]*"/gi, '$1' );
}

// Strip editable that was copied from inside. (#9534)
if ( data.match( /^<[^<]+cke_editable/i ) ) {
var header, wrapper = new CKEDITOR.dom.element( 'div' );

wrapper.setHtml( data );
// Verify for sure.
if ( wrapper.getChildCount() == 1 && ( header = wrapper.getFirst() ).hasClass( 'cke_editable' ) )
// Strip editable and bogus <br> (added on FF).
data = header.getHtml().replace( /<br>$/i, '' );
}

if ( CKEDITOR.env.ie ) {
// &nbsp; <p> -> <p> (br.cke-pasted-remove will be removed later)
data = data.replace( /^&nbsp;(?: |\r\n)?<(\w+)/g, function( match, elementName ) {

0 comments on commit 3cbf8af

Please sign in to comment.
You can’t perform that action at this time.