Skip to content

Commit

Permalink
Use next_token() in HTML Processor
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Jan 1, 2024
1 parent cceffe4 commit b712690
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
*/
const MAX_BOOKMARKS = 100;

/**
* Static query for instructing the Tag Processor to visit every token.
*
* @access private
*
* @since 6.4.0
*
* @var array
*/
const VISIT_EVERYTHING = array( 'tag_closers' => 'visit' );

/**
* Holds the working state of the parser, including the stack of
* open elements and the stack of active formatting elements.
Expand Down Expand Up @@ -516,7 +505,9 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) {
$this->state->stack_of_open_elements->pop();
}

parent::next_tag( self::VISIT_EVERYTHING );
while ( parent::next_token() && '#tag' !== $this->get_node_type() ) {
continue;
}
}

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

0 comments on commit b712690

Please sign in to comment.