Skip to content

Commit d2f073d

Browse files
committed
Reconstruct formatting at PLAINTEXT (wrong), ignore PLAINTEXT in SELECT
1 parent 096fc8e commit d2f073d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,8 @@ private function step_in_body(): bool {
21222122
$this->close_a_p_element();
21232123
}
21242124

2125+
$this->reconstruct_active_formatting_elements();
2126+
21252127
$this->insert_html_element( $this->state->current_token );
21262128
return true;
21272129

@@ -2222,6 +2224,7 @@ private function step_in_body(): bool {
22222224
}
22232225

22242226
$this->state->stack_of_open_elements->remove_node( $node );
2227+
return true;
22252228
} else {
22262229
/*
22272230
* > If the stack of open elements does not have a form element in scope,
@@ -2243,7 +2246,6 @@ private function step_in_body(): bool {
22432246
$this->state->stack_of_open_elements->pop_until( 'FORM' );
22442247
return true;
22452248
}
2246-
break;
22472249

22482250
/*
22492251
* > An end tag whose tag name is "p"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,10 @@ private function base_class_next_token(): bool {
975975
}
976976

977977
if ( 'PLAINTEXT' === $tag_name ) {
978+
if ( WP_HTML_Processor_State::INSERTION_MODE_IN_SELECT === ( $this->insertion_mode ?? null ) ) {
979+
return true;
980+
}
981+
978982
$doc_length = strlen( $this->html );
979983
$this->text_starts_at = $this->token_starts_at + $this->token_length;
980984
$this->text_length = $doc_length - $this->text_starts_at;

0 commit comments

Comments
 (0)