Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Implement HR tag handling
  • Loading branch information
sirreal committed Jan 18, 2024
commit e89e2a287e8079c809207bfe61daa5b6a8f839dc
12 changes: 11 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,17 @@ 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 "hr"
*/
case '+HR':
if ( $this->state->stack_of_open_elements->has_p_in_button_scope() ) {
$this->close_a_p_element();
}
$this->insert_html_element( $this->state->current_token );
$this->state->frameset_ok = false;
return true;
}

/*
Expand Down Expand Up @@ -977,7 +988,6 @@ private function step_in_body() {
case 'FRAME':
case 'FRAMESET':
case 'HEAD':
case 'HR':
case 'HTML':
case 'IFRAME':
case 'INPUT':
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 @@ -173,7 +173,6 @@ public function data_unsupported_special_in_body_tags() {
'FRAME' => array( 'FRAME' ),
'FRAMESET' => array( 'FRAMESET' ),
'HEAD' => array( 'HEAD' ),
'HR' => array( 'HR' ),
'HTML' => array( 'HTML' ),
'IFRAME' => array( 'IFRAME' ),
'INPUT' => array( 'INPUT' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public function data_unsupported_elements() {
'FRAME',
'FRAMESET',
'HEAD',
'HR',
'HTML',
'IFRAME',
'INPUT',
Expand Down