Skip to content

Commit

Permalink
Add tagname to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed Apr 22, 2024
1 parent 4fb1a90 commit 225334a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ private function process_directives_args( string $html, array &$context_stack, a
*/
if ( 'SVG' === $tag_name || 'MATH' === $tag_name ) {
if ( $p->get_attribute_names_with_prefix( 'data-wp-' ) ) {
$message = __( 'SVG or MATH tags are currently incompatible with the directives processing. Please refrain from adding directives to them.' );
/* translators: 1: SVG or MATH HTML tag. */
$message = sprintf( '%1s tags are currently incompatible with the directives processing. Please refrain from adding directives to them.', $tag_name );
_doing_it_wrong( __METHOD__, $message, '6.6' );
}
$p->skip_to_tag_closer();
Expand All @@ -282,7 +283,8 @@ private function process_directives_args( string $html, array &$context_stack, a
* stops processing it.
*/
$unbalanced = true;
$message = __( 'Due to an unbalanced tag in the processed HTML, the Server-Side Rendering directives processing will not function correctly.' );
/* translators: 1: Tag that caused the error, could by any HTML tag. */
$message = sprintf( 'Due to an unbalanced %1s tag in the processed HTML, the Server-Side Rendering directives processing will not function correctly.', $tag_name );
_doing_it_wrong( __METHOD__, $message, '6.6' );
break;
} else {
Expand Down Expand Up @@ -356,7 +358,6 @@ private function process_directives_args( string $html, array &$context_stack, a
}
}
}

/*
* It returns null if the HTML is unbalanced because unbalanced HTML is
* not safe to process. In that case, the Interactivity API runtime will
Expand Down

0 comments on commit 225334a

Please sign in to comment.