From f2fa0c930d5b90c339616c02ca4bd88fe3b05f5c Mon Sep 17 00:00:00 2001 From: navigatrum <6989338+navigatrum@users.noreply.github.com> Date: Mon, 27 Jun 2022 14:26:46 +0200 Subject: [PATCH] strip whitespaces in render_block_core_cover (#40859) Stopgap solution to remove whitespaces from html tags generated by render_block_core_covermarkup before injecting the featured image. Follows on from [#39658]( https://github.com/WordPress/gutenberg/pull/39658). Remove whitespaces from html tags generated by `render_block_core_covermarkup` before injecting the featured image. For the block layout see: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/cover/edit/index.js#L327-L367 For the HTML tags capturing by class name see: https://github.com/WordPress/gutenberg/blob/51db4bf888e6b18cf9d18266108114d61070f3ad/lib/block-supports/layout.php#L232 Co-authored-by: Adam Zielinski --- packages/block-library/src/cover/index.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/cover/index.php b/packages/block-library/src/cover/index.php index 3bc03a6d1bf382..b67b4823027a38 100644 --- a/packages/block-library/src/cover/index.php +++ b/packages/block-library/src/cover/index.php @@ -32,12 +32,15 @@ function render_block_core_cover( $attributes, $content ) { $image = get_the_post_thumbnail( null, 'post-thumbnail', $attr ); - $content = str_replace( - '' . $image . '