diff --git a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js index e56e3da334..48775f9d3c 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -140,7 +140,11 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { editor.on( 'SetContent', function( event ) { var body, padNode; - wp.mce.views.render(); + // don't (re-)render views if the format of the content is raw + // to avoid adding additional undo levels on undo/redo + if ( event.format !== 'raw' ) { + wp.mce.views.render(); + } // Add padding
if the noneditable node is last if ( event.load || ! event.set ) {