mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 08:10:04 +00:00
TinyMCE: remove the empty paragraph that sometimes is left over after adding an image caption.
Fixes #32003. git-svn-id: https://develop.svn.wordpress.org/trunk@32141 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -452,15 +452,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
|
||||
if ( parent = dom.getParent( node, 'p' ) ) {
|
||||
parent.parentNode.insertBefore( wrap, parent );
|
||||
|
||||
if ( dom.isEmpty( parent ) ) {
|
||||
dom.remove( parent );
|
||||
}
|
||||
} else {
|
||||
node.parentNode.insertBefore( wrap, node );
|
||||
}
|
||||
|
||||
editor.$( wrap ).find( 'dt.wp-caption-dt' ).append( node );
|
||||
|
||||
if ( parent && dom.isEmpty( parent ) ) {
|
||||
dom.remove( parent );
|
||||
}
|
||||
}
|
||||
} else if ( captionNode ) {
|
||||
// Remove the caption wrapper and place the image in new paragraph
|
||||
@@ -734,15 +734,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
|
||||
if ( parent = dom.getParent( node, 'p' ) ) {
|
||||
parent.parentNode.insertBefore( wrap, parent );
|
||||
|
||||
if ( dom.isEmpty( parent ) ) {
|
||||
dom.remove( parent );
|
||||
}
|
||||
} else {
|
||||
node.parentNode.insertBefore( wrap, node );
|
||||
}
|
||||
|
||||
editor.$( wrap ).find( 'dt.wp-caption-dt' ).append( node );
|
||||
|
||||
if ( parent && dom.isEmpty( parent ) ) {
|
||||
dom.remove( parent );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( wrap ) {
|
||||
|
||||
Reference in New Issue
Block a user