Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Allow pasting text to image caption #3986

Closed
wants to merge 4 commits into from

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Mar 11, 2016

Fixes #1658

This pull request seeks to resolve an issue where pasting while the current selection is within an image caption would cause the caption to be added to the paragraph following the image, not the image caption itself.

Testing instructions:

Verify that you can paste text into a caption, including when selecting the entire caption via double- or triple-click.

  1. Navigate to the Calypso post editor
  2. Select a site, if prompted
  3. Insert an image to post contents
  4. If not captioned already, select the image, and click Add Caption in the inline image toolbar
  5. Place cursor within or select caption contents
  6. Paste text
  7. Note that clipboard contents are inserted within the caption itself

Follow-up tasks:

We should pursue one of the following:

  • Propose change to TinyMCE paste plugin to use editor.selection.setContent when pasting, in place of editor.insertContent
  • Submit patch to WordPress core Trac with equivalent changes as implemented here

@aduth aduth added [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. labels Mar 11, 2016
@lancewillett
Copy link
Contributor

CC @azaozz for follow-up tasks.

aduth added 2 commits March 11, 2016 16:35
Bypasses mceInsertContent handler for inserting paragraph after caption
if it’s determined the pasted content consists only of inline elements
@aduth aduth added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 15, 2016
@aduth
Copy link
Contributor Author

aduth commented Apr 14, 2016

@lancewillett
Copy link
Contributor

Looks like this is still pending inclusion in core WordPress of the proposed change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Feature] Post/Page Editor The editor for editing posts and pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor: cannot paste into caption
2 participants