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

Fixes #34642.
Built from https://develop.svn.wordpress.org/trunk@35597


git-svn-id: http://core.svn.wordpress.org/trunk@35561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-11-10 04:32:25 +00:00
parent 1f24f52673
commit 8b3c5fb300
4 changed files with 10 additions and 7 deletions

View File

@ -472,16 +472,19 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
}
if ( editor.getParam( 'wp_paste_filters', true ) ) {
if ( ! tinymce.Env.webkit ) {
// In WebKit handled by removeWebKitStyles()
editor.on( 'PastePreProcess', function( event ) {
editor.on( 'PastePreProcess', function( event ) {
// Remove trailing <br> added by WebKit browsers to the clipboard
event.content = event.content.replace( /<br class="?Apple-interchange-newline"?>/gi, '' );
// In WebKit this is handled by removeWebKitStyles()
if ( ! tinymce.Env.webkit ) {
// Remove all inline styles
event.content = event.content.replace( /(<[^>]+) style="[^"]*"([^>]*>)/gi, '$1$2' );
// Put back the internal styles
event.content = event.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi, '$1 style=$2' );
});
}
}
});
editor.on( 'PastePostProcess', function( event ) {
// Remove empty paragraphs

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-beta3-35596';
$wp_version = '4.4-beta3-35597';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.