Open spacedmonkey opened 5 years ago
This would be awesome to have.
After a chat with @swissspidy I believe this work breaks down into two pieces.
Not sure which is the best course of action here....
This would be really nice! We could do it for [embed]...[/embed]
but would have to leave any with width
or height
attributes, as the embed block just puts the URL on its own line, so can't specify the width or height.
Just to clarify, converting the [embed]
shortcodes to URLs works because we have a REST API to preview embed rendering. It would get a little messy to extract the URL from the shortcode for previewing, but still render it as a shortcode... and I don't think we have an API for previewing shortcodes?
Wanted to report the same problem and found this issue. To recap:
In the Classic Editor or in the Gutenberg classic block, an embed shortcode like the following renders a nice preview:
[embed]https://vimeo.com/22439234[/embed]
Hello this is some text.
The same applies to other embeds, for example: a tweet:
[embed]https://twitter.com/nacin/status/319508408669708289[/embed]
In Gutenberg, when converting a "classic" embed shortcode to blocks, users get this:
Besides the fact there's no preview, which lacks parity with the classic editor, I'd say the UI is a bit unclear. I'm always in doubt what to do:
[embed][/embed]
and just keep the URL? nothing changesAt the very least, the UI should make clear shortcodes like these have no preview at the moment. This would help users make an informed decision and, for example, just manually transform the shortcode block to an Embed block.
Of course a smarter transform with an actual preview would be very welcome 🙂
All the embed shortcodes found in content, should be converted to embed blocks when viewing in editor. Without this embed, the embed is not previewed.