diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php
index 42675ecd3c..044d1f0c36 100644
--- a/wp-includes/html-api/class-wp-html-tag-processor.php
+++ b/wp-includes/html-api/class-wp-html-tag-processor.php
@@ -722,7 +722,7 @@ class WP_HTML_Tag_Processor {
}
$this->bookmarks[ $name ] = new WP_HTML_Span(
- $this->tag_name_starts_at - 1,
+ $this->tag_name_starts_at - ( $this->is_closing_tag ? 2 : 1 ),
$this->tag_ends_at
);
@@ -1504,7 +1504,7 @@ class WP_HTML_Tag_Processor {
$this->bytes_already_parsed = $this->bookmarks[ $bookmark_name ]->start;
$this->bytes_already_copied = $this->bytes_already_parsed;
$this->output_buffer = substr( $this->html, 0, $this->bytes_already_copied );
- return $this->next_tag();
+ return $this->next_tag( array( 'tag_closers' => 'visit' ) );
}
/**
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 85875cc15f..cefe5f3564 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '6.2-beta3-55406';
+$wp_version = '6.2-beta3-55407';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.