wordpress-mobile / WordPress-Editor-Android

⛔️ [DEPRECATED] A reusable Android rich text editor component.
GNU General Public License v2.0
188 stars 50 forks source link

Image captions added in legacy editor are stripped in visual editor #433

Closed rachelmcr closed 8 years ago

rachelmcr commented 8 years ago

Expected behavior

Image captions added to an image in the legacy editor should be retained when the visual editor is enabled.

Actual behavior

After enabling the visual editor, the image caption text is stripped.

Steps to reproduce

  1. Go to App Settings and toggle the visual editor off
  2. Create a new blog post
  3. Add an image from the device
  4. Add a caption to the image
  5. Publish the post or save it as a draft on the server
  6. Open the post in the editor and confirm the caption was published/saved correctly
  7. Go to App Settings and toggle the visual editor on
  8. Open the post in the editor

Result: The image is there with [caption] shortcodes (including width and alignment), but the caption text is stripped.

Tested on Nexus 9, Android 6.0.1, WPAndroid alpha-16

Reported by a user in 114164-h

aforcier commented 8 years ago

This looks to be due to a discrepancy between the way the legacy editor stores captions and how Calypso (and the visual editor) does it.

Legacy:

[caption align="alignnone" caption="Caption text"]<image>[/caption]

Calypso/visual editor:

[caption align="alignnone"]<image>Caption text[/caption]

If after step 5 above you open the post in the Calypso editor and switch to HTML mode, the shortcode is also stripped.

aforcier commented 8 years ago

Note: the above also happens with the self-hosted editor.

aforcier commented 8 years ago

Fixed in https://github.com/wordpress-mobile/WordPress-Android/issues/4365.