mirror of
git://develop.git.wordpress.org/
synced 2025-03-21 12:29:53 +01: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:
parent
9781cdb9a3
commit
ab5685e6ad
@ -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 ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user