Make WordPress Core

Changeset 43336


Ignore:
Timestamp:
06/08/2018 08:58:51 AM (8 years ago)
Author:
azaozz
Message:

TinyMCE: prevent creation of paragraphs from multiple HTML comments when wpautop is disabled.

Fixes #44308.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

    r43309 r43336  
    114114                        }
    115115
    116                         if ( event.load && event.format !== 'raw' && hasWpautop ) {
    117                                 event.content = wp.editor.autop( event.content );
     116                        if ( event.load && event.format !== 'raw' ) {
     117                                if ( hasWpautop ) {
     118                                        event.content = wp.editor.autop( event.content );
     119                                } else {
     120                                        // Prevent creation of paragraphs out of multiple HTML comments.
     121                                        event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
     122                                }
    118123                        }
    119124
     
    609614                if ( hasWpautop ) {
    610615                        event.content = wp.editor.removep( event.content );
     616                } else {
     617                        // Restore formatting of block boundaries.
     618                        event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );
    611619                }
    612620        });
Note: See TracChangeset for help on using the changeset viewer.