Skip to content

Commit

Permalink
table processing
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jul 3, 2024
1 parent 5a6e041 commit bd16b4a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,7 @@ private function step_in_body() {
$this->insert_html_element( $this->state->current_token );
$this->state->frameset_ok = false;
$this->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE;
return true;

/*
* > An end tag whose tag name is "br"
Expand Down Expand Up @@ -1703,6 +1704,7 @@ private function step_in_table() {
$this->insert_html_element(
new WP_HTML_Token( null, 'TBODY', false )
);
$this->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_TABLE_BODY;
return $this->step( self::REPROCESS_CURRENT_NODE );

/*
Expand Down Expand Up @@ -1780,13 +1782,18 @@ private function step_in_table() {
case "+FORM":
if (
$this->state->stack_of_open_elements->has_element_in_scope( 'TEMPLATE' ) ||

$this->has_element_pointer( 'FORM' )
) {
return $this->step();
}
$this->insert_html_element( $this->state->current_token );
$this->set_element_pointer( 'FORM' );
return true;

/*
* > An end-of-file token
*/

/*
* > Anything else
* > Parse error. Enable foster parenting, process the token using the rules for the
Expand Down Expand Up @@ -2391,6 +2398,14 @@ public function has_bookmark( $bookmark_name ) {
return parent::has_bookmark( "_{$bookmark_name}" );
}

private function set_element_pointer( string $tag_name ) {
return parent::set_bookmark( "element_pointer_{$tag_name}" );
}

private function has_element_pointer( string $tag_name ) {
return parent::has_bookmark( "element_pointer_{$tag_name}" );
}

/*
* HTML Parsing Algorithms
*/
Expand Down

0 comments on commit bd16b4a

Please sign in to comment.