Skip to content

Commit b8b5f8e

Browse files
committed
HTML API: Add support for HR element.
Adds support for the following HTML elements to the HTML Processor: - HR Previously, this element was not supported and the HTML Processor would bail when encountering it. Now, with this patch, it will proceed to parse an HTML document when encountering one. Developed in WordPress/wordpress-develop#5897 Props jonsurrell, dmsnell Fixes #60283 Built from https://develop.svn.wordpress.org/trunk@57314 git-svn-id: https://core.svn.wordpress.org/trunk@56820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 4cd28ef commit b8b5f8e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
* - Media elements: AUDIO, CANVAS, FIGCAPTION, FIGURE, IMG, MAP, PICTURE, VIDEO.
110110
* - Paragraph: P.
111111
* - Phrasing elements: ABBR, BDI, BDO, CITE, DATA, DEL, DFN, INS, MARK, OUTPUT, Q, SAMP, SUB, SUP, TIME, VAR.
112-
* - Sectioning elements: ARTICLE, ASIDE, NAV, SECTION.
112+
* - Sectioning elements: ARTICLE, ASIDE, HR, NAV, SECTION.
113113
* - Templating elements: SLOT.
114114
* - Text decoration: RUBY.
115115
* - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, MULTICOL, NEXTID, SPACER.
@@ -941,6 +941,17 @@ private function step_in_body() {
941941
$this->reconstruct_active_formatting_elements();
942942
$this->insert_html_element( $this->state->current_token );
943943
return true;
944+
945+
/*
946+
* > A start tag whose tag name is "hr"
947+
*/
948+
case '+HR':
949+
if ( $this->state->stack_of_open_elements->has_p_in_button_scope() ) {
950+
$this->close_a_p_element();
951+
}
952+
$this->insert_html_element( $this->state->current_token );
953+
$this->state->frameset_ok = false;
954+
return true;
944955
}
945956

946957
/*
@@ -977,7 +988,6 @@ private function step_in_body() {
977988
case 'FRAME':
978989
case 'FRAMESET':
979990
case 'HEAD':
980-
case 'HR':
981991
case 'HTML':
982992
case 'IFRAME':
983993
case 'INPUT':

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.5-alpha-57313';
19+
$wp_version = '6.5-alpha-57314';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)