-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Convert to Block replaces any Jetpack gallery with a default gallery #15134
Comments
Sounds to me like Jetpack needs to provide a custom block transform to make this work. Gutenberg itself cannot know what Jetpack does with the gallery, so it's the plugin's the responsibility to provide that info IMHO. |
That's one way of looking at it. I'd like to offer an alternative viewpoint. The Convert to Blocks function shouldn't convert a Gallery shortcode to a Gallery Block if the shortcode has invalid parameters (That is invalid as far as the original Gallery shortcode is concerned). Gallery shortcodes with invalid parameters should be converted to a shortcode block so that the author can edit any errors in the parameters -- or leave it 'as is' if it is working as intended. The presence of the Jetpack Gallery 'type' parameter makes the shortcode an invalid Gallery shortcode. If this approach is used then if a site has any plugins (Jetpack, third party or home-brewed) that replace the Gallery shortcode they will not be impacted (assuming they have additional parameters). whereas the current Convert to Block function takes a working post/page and messes it up. The above approach is also good practice in terms of ensuring the data to be converted is valid before converting it. |
This issue is being tracked in the jetpack repo: |
We need to add shortcode transform in Jetpack for Tiled gallery shortcodes: Automattic/jetpack#11779 Originally we couldn't, because Gutenberg didn't have mechanism to differentiate between identical shortcodes based on attributes (lots of plugins used to just extend I think this issue can be closed since there isn't really any action item for Gutenberg. Feel free to re-open if you think it's needed! |
On second thought, seems like a valid reason to keep this open. |
Describe the bug
Clicking on 'Convert to Blocks' on a pre-gutenberg posts converts Jetpack [gallery] shortcodes
to a 'Guttenberg Gallery'.
To reproduce
Steps to reproduce the behavior:
Expected behavior
on converting to blocks Gutenberg should create a classic block with the jetpack gallery shortcode in it.
Screenshots
![image](https://user-images.githubusercontent.com/5794634/56621921-e847f900-65f3-11e9-99a9-7719013842ff.png)
![image](https://user-images.githubusercontent.com/5794634/56622042-365cfc80-65f4-11e9-8975-447b02020e7e.png)
Original Post:
After converting to blocks:
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: