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

Empty image block prints figure and empty img elements on the front #44639

Closed
carolinan opened this issue Oct 3, 2022 · 0 comments · Fixed by #45220
Closed

Empty image block prints figure and empty img elements on the front #44639

carolinan opened this issue Oct 3, 2022 · 0 comments · Fixed by #45220
Assignees
Labels
[Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

Description

When an image block has been added to the content, but no image has been selected, there is a figure and an empty img element on the front of the website:
<figure class="wp-block-image"><img decoding="async" alt=""></figure>

Ideally nothing should be printed on the front when no image has been selected.

Step-by-step reproduction instructions

In either editor, add an image block.
Save and view the front of the website where you placed the block.
View the source of the page and see that there is a figure element and an img element without a src.

Screenshots, screen recording, code snippet

No response

Environment info

Gutenberg current trunk
WordPress 6.1 beta

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@carolinan carolinan added [Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement. labels Oct 3, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 22, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants