fixed Empty space when an empty image block#39952
fixed Empty space when an empty image block#39952poojabhimani12 wants to merge 5 commits intoWordPress:trunkfrom
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @poojabhimani12! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
Maybe we can add the check earlier at line 28: if ( ! url ) {
return null;
} |
|
Yes, I have updated code as per your comment |
| } = attributes; | ||
|
|
||
| const newRel = isEmpty( rel ) ? undefined : rel; | ||
| if ( ! url ) { |
There was a problem hiding this comment.
| if ( ! url ) { | |
| if ( ! url ) { |
There are two spaces, we need to remove one. We also can move it above the line with const newRel = ....
|
The tests are failing, we also need to adjust the snapshots: https://github.com/WordPress/gutenberg/pull/39952/checks |
|
I'm not sure this work for empty images inside a gallery block: I followed the test instructions for #39612 |
|
It seems like this issue has already been resolved, so I'd like to close it. You can check the details of the test in this comment. Therefore, I'm closing this PR. @poojabhimani12 Thank you for your contribution 😊 |

Fixed #39612
What?
Remove Empty space on the front end when an empty image block is added.
Why?
It will add an
unnecessary empty image tag on front end layout
How?
check condition if an image is set then only it will display the image tag
Testing Instructions
Open the Post page
Insert Image block but do not add any image
Front end you can check there is no empty figure tag
Screenshots or screencast