Ticket #7801: 7801.patch

File 7801.patch, 1002 bytes (added by Garry Yao, 13 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    5858                if ( range.checkReadOnly() )
    5959                        return;
    6060
     61                // Opera: force block splitting when pasted content contains block. (#7801)
     62                if ( CKEDITOR.env.opera )
     63                {
     64                        var path = new CKEDITOR.dom.elementPath( range.startContainer );
     65                        if ( path.block )
     66                        {
     67                                var nodes = CKEDITOR.htmlParser.fragment.fromHtml( data, false ).children;
     68                                for ( var i = 0, count = nodes.length; i < count; i++ )
     69                                {
     70                                        if ( nodes[ i ]._.isBlockLike )
     71                                        {
     72                                                range.splitBlock( this.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
     73                                                range.insertNode( range.document.createText( '' ) );
     74                                                range.select();
     75                                                break;
     76                                        }
     77                                }
     78                        }
     79                }
     80
    6181                if ( CKEDITOR.env.ie )
    6282                {
    6383                        var selIsLocked = selection.isLocked;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy