diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php index 3ad4009069..c6824e942c 100644 --- a/src/wp-includes/blocks/template-part.php +++ b/src/wp-includes/blocks/template-part.php @@ -151,7 +151,7 @@ function render_block_core_template_part( $attributes ) { global $wp_embed; $content = $wp_embed->autoembed( $content ); - if ( empty( $attributes['tagName'] ) ) { + if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) { $area_tag = 'div'; if ( $area_definition && isset( $area_definition['area_tag'] ) ) { $area_tag = $area_definition['area_tag'];