- Timestamp:
- 08/01/2023 07:54:54 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r56274 r56331 627 627 return true; 628 628 629 /* 630 * > Any other start tag 631 */ 632 case '+SPAN': 633 $this->reconstruct_active_formatting_elements(); 634 $this->insert_html_element( $this->current_token ); 635 return true; 636 637 /* 638 * Any other end tag 639 */ 640 case '-SPAN': 641 foreach ( $this->state->stack_of_open_elements->walk_up() as $item ) { 642 // > If node is an HTML element with the same tag name as the token, then: 643 if ( $item->node_name === $tag_name ) { 644 $this->generate_implied_end_tags( $tag_name ); 645 646 // > If node is not the current node, then this is a parse error. 647 648 $this->state->stack_of_open_elements->pop_until( $tag_name ); 649 return true; 650 } 651 652 // > Otherwise, if node is in the special category, then this is a parse error; ignore the token, and return. 653 if ( self::is_special( $item->node_name ) ) { 654 return $this->step(); 655 } 656 } 657 // Execution should not reach here; if it does then something went wrong. 658 return false; 659 629 660 default: 630 661 $this->last_error = self::ERROR_UNSUPPORTED; … … 874 905 * @since 6.4.0 875 906 * 876 * @throws Exception907 * @throws WP_HTML_Unsupported_Exception 877 908 * 878 909 * @see https://html.spec.whatwg.org/#generate-implied-end-tags … … 890 921 in_array( $this->state->stack_of_open_elements->current_node(), $elements_with_implied_end_tags, true ) 891 922 ) { 923 $this->state->stack_of_open_elements->pop(); 924 } 925 } 926 927 /* 928 * Closes elements that have implied end tags, thoroughly. 929 * 930 * See the HTML specification for an explanation why this is 931 * different from {@see WP_HTML_Processor::generate_implied_end_tags}. 932 * 933 * @since 6.4.0 934 * 935 * @see https://html.spec.whatwg.org/#generate-implied-end-tags 936 */ 937 private function generate_implied_end_tags_thoroughly() { 938 $elements_with_implied_end_tags = array( 939 'P', 940 ); 941 942 while ( in_array( $this->state->stack_of_open_elements->current_node(), $elements_with_implied_end_tags, true ) ) { 892 943 $this->state->stack_of_open_elements->pop(); 893 944 } -
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorBreadcrumbs.php
r56299 r56331 50 50 'P', 51 51 'SMALL', 52 'SPAN', 52 53 'STRIKE', 53 54 'STRONG', … … 192 193 'SOURCE', 193 194 'SPACER', // Deprecated 194 'SPAN',195 195 'STYLE', 196 196 'SUB',
Note: See TracChangeset
for help on using the changeset viewer.