Skip to content

Commit c3acbc7

Browse files
committed
Use WP_HTML_Tag_Processor to extract root-level test nodes
1 parent b0439d4 commit c3acbc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wp-includes/script-loader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,6 +3445,7 @@ function wp_enqueue_command_palette_assets() {
34453445
* @param string $label HTML string to extract text from.
34463446
* @return string Extracted text content, trimmed.
34473447
*/
3448+
34483449
$extract_root_text = static function ( $label ) {
34493450
if ( '' === $label ) {
34503451
return '';
@@ -3470,14 +3471,14 @@ function wp_enqueue_command_palette_assets() {
34703471

34713472
if ( $processor->is_tag_closer() ) {
34723473
if ( $depth > 0 ) {
3473-
$depth--;
3474+
--$depth;
34743475
}
34753476
continue;
34763477
}
34773478

34783479
$token_name = $processor->get_tag();
34793480
if ( $token_name && ! WP_HTML_Processor::is_void( $token_name ) ) {
3480-
$depth++;
3481+
++$depth;
34813482
}
34823483
}
34833484

0 commit comments

Comments
 (0)