diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.js
index d022137bc5..96fae445e1 100644
--- a/wp-includes/js/tinymce/plugins/wordpress/plugin.js
+++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.js
@@ -187,7 +187,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
var parent, html, title,
classname = 'wp-more-tag',
dom = editor.dom,
- node = editor.selection.getNode();
+ node = editor.selection.getNode(),
+ rootNode = editor.getBody();
tag = tag || 'more';
classname += ' mce-wp-' + tag;
@@ -197,14 +198,14 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />';
// Most common case
- if ( node.nodeName === 'BODY' || ( node.nodeName === 'P' && node.parentNode.nodeName === 'BODY' ) ) {
+ if ( node === rootNode || ( node.nodeName === 'P' && node.parentNode === rootNode ) ) {
editor.insertContent( html );
return;
}
// Get the top level parent node
parent = dom.getParent( node, function( found ) {
- if ( found.parentNode && found.parentNode.nodeName === 'BODY' ) {
+ if ( found.parentNode && found.parentNode === rootNode ) {
return true;
}
diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js
index a3a2f4fa0d..c1e78ca656 100644
--- a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js
+++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js
@@ -1 +1 @@
-!function(a){a.ui.FloatPanel.zIndex<100100&&(a.ui.FloatPanel.zIndex=100100),a.PluginManager.add("wordpress",function(b){function c(c){var d,f,i,j=0;f="hide"===c,b.theme.panel&&(i=b.theme.panel.find(".toolbar:not(.menubar)")),!i||i.length<2||"hide"===c&&!i[1].visible()||(!c&&i[1].visible()&&(c="hide"),h(i,function(a,b){b>0&&("hide"===c?(a.hide(),j+=30):(a.show(),j-=30))}),j&&!f&&(a.Env.iOS||(d=b.getContentAreaContainer().firstChild,g.setStyle(d,"height",d.clientHeight+j)),"hide"===c?(setUserSetting("hidetb","0"),e&&e.active(!1)):(setUserSetting("hidetb","1"),e&&e.active(!0))),b.fire("wp-toolbar-toggle"))}function d(){}var e,f,g=a.DOM,h=a.each,i=b.editorManager.i18n.translate,j=window.jQuery,k=window.wp,l=k&&k.editor&&k.editor.autop&&b.getParam("wpautop",!0);return j&&j(document).triggerHandler("tinymce-editor-setup",[b]),b.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){e=this,e.active("1"===getUserSetting("hidetb"))}}),b.on("PostRender",function(){b.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")&&c("hide")}),b.addCommand("WP_Adv",function(){c()}),b.on("focus",function(){window.wpActiveEditor=b.id}),b.on("BeforeSetContent",function(b){var c;b.content&&(b.content.indexOf("/g,function(b,d){return'
'})),b.content.indexOf("")!==-1&&(c=i("Page break"),b.content=b.content.replace(//g,'
')),b.load&&"raw"!==b.format&&l&&(b.content=k.editor.autop(b.content)),b.content.indexOf("