From e3ffbce181cf6f8685c8d7dea11ad1c581a3be1f Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 17 Jan 2017 01:24:35 +0000 Subject: [PATCH] TinyMCE: strip browser inserted `` and ` tags from inside links when copying and pasting in IE and Edge. Fixes #39570. git-svn-id: https://develop.svn.wordpress.org/trunk@39916 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 611450e066..20cdcd49ac 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -543,11 +543,17 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { editor.on( 'PastePostProcess', function( event ) { // Remove empty paragraphs - each( dom.select( 'p', event.node ), function( node ) { + editor.$( 'p', event.node ).each( function( i, node ) { if ( dom.isEmpty( node ) ) { dom.remove( node ); } }); + + if ( tinymce.isIE ) { + editor.$( 'a', event.node ).find( 'font, u' ).each( function( i, node ) { + dom.remove( node, true ); + }); + } }); }