Skip to content

Commit

Permalink
Add INPUT tag handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jan 19, 2024
1 parent cee4df3 commit ab54a24
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
13 changes: 12 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 @@ -941,6 +941,18 @@ private function step_in_body() {
$this->reconstruct_active_formatting_elements();
$this->insert_html_element( $this->state->current_token );
return true;

/*
* > A start tag whose tag name is "input"
*/
case '+INPUT':
$this->reconstruct_active_formatting_elements();
$this->insert_html_element( $this->state->current_token );
$type_attribute = $this->get_attribute( 'type' );
if ( null === $type_attribute || 'hidden' === strtolower( $type_attribute ) ) {
$this->state->frameset_ok = false;
}
return true;
}

/*
Expand Down Expand Up @@ -980,7 +992,6 @@ private function step_in_body() {
case 'HR':
case 'HTML':
case 'IFRAME':
case 'INPUT':
case 'KEYGEN':
case 'LI':
case 'LINK':
Expand Down
1 change: 0 additions & 1 deletion tests/phpunit/tests/html-api/wpHtmlProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ public function data_unsupported_special_in_body_tags() {
'HR' => array( 'HR' ),
'HTML' => array( 'HTML' ),
'IFRAME' => array( 'IFRAME' ),
'INPUT' => array( 'INPUT' ),
'KEYGEN' => array( 'KEYGEN' ),
'LINK' => array( 'LINK' ),
'LISTING' => array( 'LISTING' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ public function data_unsupported_elements() {
'HR',
'HTML',
'IFRAME',
'INPUT',
'KEYGEN', // Deprecated; void.
'LINK',
'LISTING', // Deprecated, use PRE instead.
Expand Down

0 comments on commit ab54a24

Please sign in to comment.