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

Fixes #44308.
Built from https://develop.svn.wordpress.org/trunk@43336


git-svn-id: http://core.svn.wordpress.org/trunk@43164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2018-06-28 02:25:32 +00:00
parent 1b263de2d6
commit 62bb0dcafd
4 changed files with 12 additions and 4 deletions

View File

@ -113,8 +113,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
'alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' );
}
if ( event.load && event.format !== 'raw' && hasWpautop ) {
event.content = wp.editor.autop( event.content );
if ( event.load && event.format !== 'raw' ) {
if ( hasWpautop ) {
event.content = wp.editor.autop( event.content );
} else {
// Prevent creation of paragraphs out of multiple HTML comments.
event.content = event.content.replace( /-->\s+<!--/g, '--><!--' );
}
}
if ( event.content.indexOf( '<script' ) !== -1 || event.content.indexOf( '<style' ) !== -1 ) {
@ -608,6 +613,9 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
if ( hasWpautop ) {
event.content = wp.editor.removep( event.content );
} else {
// Restore formatting of block boundaries.
event.content = event.content.replace( /-->\s*<!-- wp:/g, '-->\n\n<!-- wp:' );
}
});

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43335';
$wp_version = '5.0-alpha-43336';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.