Skip to content

Commit ddd8579

Browse files
committed
Merge branch 'html-api/scan-all-tokens' into html-api/improve-active-element-reconstruction
2 parents f412732 + 9f29920 commit ddd8579

4 files changed

Lines changed: 1379 additions & 119 deletions

File tree

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
149149
*/
150150
const MAX_BOOKMARKS = 100;
151151

152-
/**
153-
* Static query for instructing the Tag Processor to visit every token.
154-
*
155-
* @access private
156-
*
157-
* @since 6.4.0
158-
*
159-
* @var array
160-
*/
161-
const VISIT_EVERYTHING = array( 'tag_closers' => 'visit' );
162-
163152
/**
164153
* Holds the working state of the parser, including the stack of
165154
* open elements and the stack of active formatting elements.
@@ -539,7 +528,9 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
539528
$this->state->stack_of_open_elements->pop();
540529
}
541530

542-
parent::next_tag( self::VISIT_EVERYTHING );
531+
while ( parent::next_token() && '#tag' !== $this->get_token_type() ) {
532+
continue;
533+
}
543534
}
544535

545536
// Finish stepping when there are no more tokens in the document.

0 commit comments

Comments
 (0)