You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Favorites and My Patterns grid patterns: two block comments close the wrong block #791
patterns/_grid-favorites.php, line 77: the message group inside wp:query-no-results ends with <!-- wp:group /-->. That is a new, empty, self-closing group block, not a closer, so the message group stays open.
I checked both with parse_blocks() and do_blocks() on WordPress 7.1.3.
The first one has no effect today. The block tree and the rendered HTML are the same as with <!-- /wp:button -->.
The second one shifts the blocks that follow. The spacer and the suggestions group become inner blocks of the message group, <!-- /wp:query-no-results --> closes the message group, and <!-- /wp:query --> closes wp:query-no-results. So the closing </div> of the outer query block (line 107) ends up inside wp:query-no-results. When the user has favorites, that block renders nothing, and the rendered pattern has one <div> that is never closed.
An HTML5 parser repairs this. With PHP 8.5's Dom\HTMLDocument, the DOM of the full page-favorites.html template was the same with and without the fix, ignoring whitespace. So I do not expect a visible change. The served HTML is still unbalanced, and the block tree is not what the file intends.
Expected: each block comment closes the block it opened.
Activity