-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fixed Empty space when an empty image block #39952
fixed Empty space when an empty image block #39952
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 |
@@ -27,6 +27,9 @@ export default function save( { attributes } ) { | |||
} = attributes; | |||
|
|||
const newRel = isEmpty( rel ) ? undefined : rel; | |||
if ( ! url ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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