mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02:00
HTML API: Add support for PRE and LISTING elements.
Adds support for the following HTML elements to the HTML Processor: - PRE, LISTING Previously, these elements were not supported and the HTML Processor would bail when encountering them. Now, with this patch applied, it will proceed to parse an HTML document when encountering those tags. Developed in WordPress/wordpress-develop#5903 Props jonsurrell, dmsnell Fixes #60283 Built from https://develop.svn.wordpress.org/trunk@57317 git-svn-id: http://core.svn.wordpress.org/trunk@56823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
050c342a46
commit
cf88a3098c
@ -102,7 +102,7 @@
|
|||||||
* - Containers: ADDRESS, BLOCKQUOTE, DETAILS, DIALOG, DIV, FOOTER, HEADER, MAIN, MENU, SPAN, SUMMARY.
|
* - Containers: ADDRESS, BLOCKQUOTE, DETAILS, DIALOG, DIV, FOOTER, HEADER, MAIN, MENU, SPAN, SUMMARY.
|
||||||
* - Custom elements: All custom elements are supported. :)
|
* - Custom elements: All custom elements are supported. :)
|
||||||
* - Form elements: BUTTON, DATALIST, FIELDSET, LABEL, LEGEND, METER, PROGRESS, SEARCH.
|
* - Form elements: BUTTON, DATALIST, FIELDSET, LABEL, LEGEND, METER, PROGRESS, SEARCH.
|
||||||
* - Formatting elements: B, BIG, CODE, EM, FONT, I, SMALL, STRIKE, STRONG, TT, U, WBR.
|
* - Formatting elements: B, BIG, CODE, EM, FONT, I, PRE, SMALL, STRIKE, STRONG, TT, U, WBR.
|
||||||
* - Heading elements: H1, H2, H3, H4, H5, H6, HGROUP.
|
* - Heading elements: H1, H2, H3, H4, H5, H6, HGROUP.
|
||||||
* - Links: A.
|
* - Links: A.
|
||||||
* - Lists: DD, DL, DT, LI, OL, LI.
|
* - Lists: DD, DL, DT, LI, OL, LI.
|
||||||
@ -112,7 +112,7 @@
|
|||||||
* - Sectioning elements: ARTICLE, ASIDE, HR, NAV, SECTION.
|
* - Sectioning elements: ARTICLE, ASIDE, HR, NAV, SECTION.
|
||||||
* - Templating elements: SLOT.
|
* - Templating elements: SLOT.
|
||||||
* - Text decoration: RUBY.
|
* - Text decoration: RUBY.
|
||||||
* - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, KEYGEN, MULTICOL, NEXTID, SPACER.
|
* - Deprecated elements: ACRONYM, BLINK, CENTER, DIR, ISINDEX, KEYGEN, LISTING, MULTICOL, NEXTID, SPACER.
|
||||||
*
|
*
|
||||||
* ### Supported markup
|
* ### Supported markup
|
||||||
*
|
*
|
||||||
@ -684,10 +684,12 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
|||||||
case '-FOOTER':
|
case '-FOOTER':
|
||||||
case '-HEADER':
|
case '-HEADER':
|
||||||
case '-HGROUP':
|
case '-HGROUP':
|
||||||
|
case '-LISTING':
|
||||||
case '-MAIN':
|
case '-MAIN':
|
||||||
case '-MENU':
|
case '-MENU':
|
||||||
case '-NAV':
|
case '-NAV':
|
||||||
case '-OL':
|
case '-OL':
|
||||||
|
case '-PRE':
|
||||||
case '-SEARCH':
|
case '-SEARCH':
|
||||||
case '-SECTION':
|
case '-SECTION':
|
||||||
case '-SUMMARY':
|
case '-SUMMARY':
|
||||||
@ -732,6 +734,18 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
|||||||
$this->insert_html_element( $this->state->current_token );
|
$this->insert_html_element( $this->state->current_token );
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* > A start tag whose tag name is one of: "pre", "listing"
|
||||||
|
*/
|
||||||
|
case '+PRE':
|
||||||
|
case '+LISTING':
|
||||||
|
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;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* > An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5", "h6"
|
* > An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5", "h6"
|
||||||
*/
|
*/
|
||||||
@ -1007,7 +1021,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
|||||||
case 'INPUT':
|
case 'INPUT':
|
||||||
case 'LI':
|
case 'LI':
|
||||||
case 'LINK':
|
case 'LINK':
|
||||||
case 'LISTING':
|
|
||||||
case 'MARQUEE':
|
case 'MARQUEE':
|
||||||
case 'MATH':
|
case 'MATH':
|
||||||
case 'META':
|
case 'META':
|
||||||
@ -1021,7 +1034,6 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
|||||||
case 'OPTION':
|
case 'OPTION':
|
||||||
case 'PARAM':
|
case 'PARAM':
|
||||||
case 'PLAINTEXT':
|
case 'PLAINTEXT':
|
||||||
case 'PRE':
|
|
||||||
case 'RB':
|
case 'RB':
|
||||||
case 'RP':
|
case 'RP':
|
||||||
case 'RT':
|
case 'RT':
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.5-alpha-57316';
|
$wp_version = '6.5-alpha-57317';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user