Make WordPress Core

Changeset 35597


Ignore:
Timestamp:
11/10/2015 04:31:04 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE: always remove trailing <br> added by WebKit browsers to the clipboard.

Fixes #34642.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r35567 r35597  
    473473
    474474                if ( editor.getParam( 'wp_paste_filters', true ) ) {
    475                         if ( ! tinymce.Env.webkit ) {
    476                                 // In WebKit handled by removeWebKitStyles()
    477                                 editor.on( 'PastePreProcess', function( event ) {
     475                        editor.on( 'PastePreProcess', function( event ) {
     476                                // Remove trailing <br> added by WebKit browsers to the clipboard
     477                                event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' );
     478
     479                                // In WebKit this is handled by removeWebKitStyles()
     480                                if ( ! tinymce.Env.webkit ) {
    478481                                        // Remove all inline styles
    479482                                        event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
    … …  
    481484                                        // Put back the internal styles
    482485                                        event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
    483                                 });
    484                         }
     486                                }
     487                        });
    485488
    486489                        editor.on( 'PastePostProcess', function( event ) {
Note: See TracChangeset for help on using the changeset viewer.