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:
parent
1b263de2d6
commit
62bb0dcafd
|
@ -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
Binary file not shown.
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue