diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 8209ba4109..17bda8861a 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -131,10 +131,9 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } // Remove spaces from empty paragraphs. - // Avoid backtracking, can freeze the editor. See #35890. - // (This is also quite faster than using only one regex.) + // Try to avoid a lot of backtracking, can freeze the editor. See #35890 and #38294. event.content = event.content.replace( /

([^<>]+)<\/p>/gi, function( tag, text ) { - if ( /^( |\s|\u00a0|\ufeff)+$/i.test( text ) ) { + if ( text === ' ' || ! /\S/.test( text ) ) { return '


'; }