- Timestamp:
- 02/04/2025 02:47:41 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.7/src/wp-includes/html-api/class-wp-html-processor.php
r59721 r59757 609 609 610 610 /** 611 * Ensures internal accounting is maintained for HTML semantic rules while 612 * the underlying Tag Processor class is seeking to a bookmark. 611 * Finds the next token in the HTML document. 613 612 * 614 613 * This doesn't currently have a way to represent non-tags and doesn't process … … 617 616 * 618 617 * @since 6.5.0 Added for internal support; do not use. 618 * @since 6.7.2 Refactored so subclasses may extend. 619 * 620 * @return bool Whether a token was parsed. 621 */ 622 public function next_token(): bool { 623 return $this->next_visitable_token(); 624 } 625 626 /** 627 * Ensures internal accounting is maintained for HTML semantic rules while 628 * the underlying Tag Processor class is seeking to a bookmark. 629 * 630 * This doesn't currently have a way to represent non-tags and doesn't process 631 * semantic rules for text nodes. For access to the raw tokens consider using 632 * WP_HTML_Tag_Processor instead. 633 * 634 * Note that this method may call itself recursively. This is why it is not 635 * implemented as {@see WP_HTML_Processor::next_token()}, which instead calls 636 * this method similarly to how {@see WP_HTML_Tag_Processor::next_token()} 637 * calls the {@see WP_HTML_Tag_Processor::base_class_next_token()} method. 638 * 639 * @since 6.7.2 Added for internal support. 619 640 * 620 641 * @access private … … 622 643 * @return bool 623 644 */ 624 p ublic function next_token(): bool {645 private function next_visitable_token(): bool { 625 646 $this->current_element = null; 626 647 … … 640 661 */ 641 662 if ( empty( $this->element_queue ) && $this->step() ) { 642 return $this->next_ token();663 return $this->next_visitable_token(); 643 664 } 644 665 … … 651 672 } 652 673 653 return empty( $this->element_queue ) ? false : $this->next_ token();674 return empty( $this->element_queue ) ? false : $this->next_visitable_token(); 654 675 } 655 676 … … 662 683 */ 663 684 if ( 'root-node' === $this->current_element->token->bookmark_name ) { 664 return $this->next_ token();685 return $this->next_visitable_token(); 665 686 } 666 687 … … 674 695 // Avoid sending close events for elements which don't expect a closing. 675 696 if ( $is_pop && ! $this->expects_closer( $this->current_element->token ) ) { 676 return $this->next_ token();697 return $this->next_visitable_token(); 677 698 } 678 699
Note: See TracChangeset
for help on using the changeset viewer.