mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
TinyMCE: prevent creation of paragraphs from multiple HTML comments when wpautop is disabled.
Fixes #44308. git-svn-id: https://develop.svn.wordpress.org/trunk@43336 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+10
-2
@@ -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:' );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user