[wp-trac] [WordPress Trac] #58174: A shortcode block that evaluates to nothing, renders as a space in the HTML
WordPress Trac
noreply at wordpress.org
Sat Apr 22 13:07:07 UTC 2023
#58174: A shortcode block that evaluates to nothing, renders as a space in the HTML
--------------------------+-----------------------------
Reporter: asafm7 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
A shortcode block that evaluates to nothing renders as a space in the
HTML.
A screenshot:
https://drive.google.com/file/d/1wjDAXVgrqE5L5pzTJDKuTo606XzuTZ4k/view?usp=drivesdk
I've noticed it while using an [acf] shortcode referencing an empty field,
but it also happens with an empty [audio] core shortcode.
This makes styling with CSS cumbersome. For example, the :empty selector
can't be used.
When I remove the shortcode block, leaving the column block completely
empty, the redundant space isn't being rendered (so it isn't a browser
issue).
I've tried to reverse-engineer it really hard, even trying to catch the
HTML at the last minute in the get_the_block_template_html() function, but
I couldn't find the culprit spaces.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58174>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list