WordPress.org

Make WordPress Core

Changeset 40786


Ignore:
Timestamp:
05/18/17 22:24:57 (6 months ago)
Author:
azaozz
Message:

TinyMCE: fix pasting while an image with caption is selected. The image and the caption should be replaced with the pasted content.

Fixes #40809.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r40110 r40786  
    913913                    dom.insertAfter( p, captionParent ); 
    914914                    editor.selection.setCursorLocation( p, 0 ); 
     915 
     916                    // If the image is selected and the user pastes "over" it, 
     917                    // replace both the image and the caption elements with the pasted content. 
     918                    // This matches the behavior when pasting over non-caption images. 
     919                    if ( node.nodeName === 'IMG' ) { 
     920                        editor.$( captionParent ).remove(); 
     921                    } 
     922 
    915923                    editor.nodeChanged(); 
    916924                } else { 
Note: See TracChangeset for help on using the changeset viewer.