mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 07:22:01 +01:00
TinyMCE: fix pasting while an image with caption is selected. The image and the caption should be replaced with the pasted content.
Fixes #40809. Built from https://develop.svn.wordpress.org/trunk@40786 git-svn-id: http://core.svn.wordpress.org/trunk@40644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e62f6ac8fe
commit
b398ccf2a1
@ -912,6 +912,14 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
p = dom.create( 'p' );
|
||||
dom.insertAfter( p, captionParent );
|
||||
editor.selection.setCursorLocation( p, 0 );
|
||||
|
||||
// If the image is selected and the user pastes "over" it,
|
||||
// replace both the image and the caption elements with the pasted content.
|
||||
// This matches the behavior when pasting over non-caption images.
|
||||
if ( node.nodeName === 'IMG' ) {
|
||||
editor.$( captionParent ).remove();
|
||||
}
|
||||
|
||||
editor.nodeChanged();
|
||||
} else {
|
||||
// Clicking Indent or Outdent while an image with a caption is selected breaks the caption.
|
||||
|
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 = '4.8-beta1-40785';
|
||||
$wp_version = '4.8-beta1-40786';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user