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:
@@ -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.
Reference in New Issue
Block a user