WordPress.org

Make WordPress Core

Changeset 40996


Ignore:
Timestamp:
07/03/2017 09:40:22 PM (3 years ago)
Author:
azaozz
Message:

TinyMCE: fix adding the <!-- more --> tag when the editor is inline.

Props iseulde.
Fixes #41230.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r40990 r40996  
    188188            classname = 'wp-more-tag',
    189189            dom = editor.dom,
    190             node = editor.selection.getNode();
     190            node = editor.selection.getNode(),
     191            rootNode = editor.getBody();
    191192
    192193        tag = tag || 'more';
     
    198199
    199200        // Most common case
    200         if ( node.nodeName === 'BODY' || ( node.nodeName === 'P' && node.parentNode.nodeName === 'BODY' ) ) {
     201        if ( node === rootNode || ( node.nodeName === 'P' && node.parentNode === rootNode ) ) {
    201202            editor.insertContent( html );
    202203            return;
     
    205206        // Get the top level parent node
    206207        parent = dom.getParent( node, function( found ) {
    207             if ( found.parentNode && found.parentNode.nodeName === 'BODY' ) {
     208            if ( found.parentNode && found.parentNode === rootNode ) {
    208209                return true;
    209210            }
Note: See TracChangeset for help on using the changeset viewer.