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

Conversion from Classic to Blocks: caption shortcode fails to convert correctly #12310

Closed
afercia opened this issue Nov 26, 2018 · 0 comments · Fixed by #12315
Closed

Conversion from Classic to Blocks: caption shortcode fails to convert correctly #12310

afercia opened this issue Nov 26, 2018 · 0 comments · Fixed by #12315
Labels
[Feature] Block Transforms Block transforms from one block to another [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Nov 26, 2018

Tested with the captioned image shortcode from the themes unit test data:

[caption id="attachment_754" align="alignnone" width="604"]<a href="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg"><img class="wp-image-754 size-large" src="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg?w=604" alt="Bell on Wharf" width="604" height="453" /></a> Bell on wharf in San Francisco[/caption]
  • open a post with the content above in Gutenberg (adjust the attachment ID if needed)
  • content is in a Classic block, as expected:

screenshot 2018-11-26 at 11 33 47

  • in the Classic block "More Options" menu, click "Convert to Blocks"
  • the captioned image gets converted to an Image block with two images: the second image is within the caption:

screenshot 2018-11-26 at 11 50 37

Code after conversion:

<!-- wp:image {"id":754,"align":"none"} -->
<figure class="wp-block-image alignnone"><a href="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg"><img src="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg?w=604" alt="Bell on Wharf" class="wp-image-754"/></a><figcaption><a href="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg"><img class="wp-image-754 size-large" src="http://build.wordpress-develop.test/wp-content/uploads/2011/07/100_5478.jpg?w=604" alt="Bell on Wharf" width="604" height="453" /></a> Bell on wharf in San Francisco</figcaption></figure>
<!-- /wp:image -->
@afercia afercia added the [Type] Bug An existing feature does not function as intended label Nov 26, 2018
@designsimply designsimply added the [Feature] Block Transforms Block transforms from one block to another label Nov 27, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Nov 29, 2018
@youknowriad youknowriad added this to the WordPress 5.0.3 milestone Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Transforms Block transforms from one block to another [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants