Ticket #7146: 7146.patch

File 7146.patch, 1.1 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/clipboard/plugin.js

     
    237237
    238238                        // Grab the HTML contents.
    239239                        // We need to look for a apple style wrapper on webkit it also adds
    240                         // a div wrapper if you copy/paste the body of the editor.
     240                        // a div wrapper if you copy/paste the body of the editor (#7146).
    241241                        // Remove hidden div and restore selection.
    242                         var bogusSpan;
     242                        var bogus;
    243243                        pastebin = ( CKEDITOR.env.webkit
    244                                                  && ( bogusSpan = pastebin.getFirst() )
    245                                                  && ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ?
    246                                                         bogusSpan : pastebin );
     244                                                 && ( bogus = pastebin.getFirst() )
     245                                                 && bogus.type == CKEDITOR.NODE_ELEMENT
     246                                                 && ( bogus.hasClass( 'Apple-style-span' )
     247                                                                || bogus.is( 'div' ) && bogus.getStyle( 'background-color' ) == 'rgb(255, 255, 255)' ) ?
     248                                                        bogus : pastebin );
    247249
    248250                        sel.selectBookmarks( bms );
    249251                        callback( pastebin[ 'get' + ( mode == 'text' ? 'Value' : 'Html' ) ]() );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy