Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Editor: Adding a link and caption to an image breaks all the things #16405

Closed shaunandrews closed 6 years ago

shaunandrews commented 7 years ago

Steps to reproduce

  1. Start a new post/page/whatev — just load the editor somehow.
  2. Add an image to your fabulous new post.
  3. Now, that image deserves a link. Give it one.
  4. You know what else that image needs? A caption! Give it a caption...
  5. Boom, nice work. You broke it.

Safari Version 10.1.1 (12603.2.4) Latest MacOS

screen_shot_2017-07-20_at_16 54 56_720
designsimply commented 7 years ago

Tested and confirmed that linking an image then adding a caption effectively removes the link. I found in my testing that the order matters—linking then captioning breaks the link.

Video: 2m22s

screen shot 2017-07-20 at thu jul 20 9 51 34 am Seen at https://wordpress.com/post/design5279.wordpress.com/11297 using Firefox 54.0.1 on Mac OS X 10.12.5.

Linking then captioning an image results in the link being moved outside the image and rendering it ineffective:

  1. Insert an image into a post or page.
  2. Click the image.
  3. Click the link icon in the editor toolbar.
  4. Select a past post.
  5. Click the image.
  6. Click the caption icon in the image toolbar.
  7. View the HTML and check to make sure the image is linked properly.

Result: the images not linked—the HTML for the link was pushed outside of the captioned image.

Captioning then linking an image works:

  1. Insert an image into a post or page.
  2. Click the image.
  3. Click the caption icon in the image toolbar.
  4. Click the image.
  5. Click the link icon in the editor toolbar.
  6. Select a past post.
  7. View the HTML and check to make sure the image is linked properly.

Result: the image was linked as expected.

rachelmcr commented 6 years ago

This one has been around a while. Closing as a dupe of https://github.com/Automattic/wp-calypso/issues/7781.