HTML API: Make WP_HTML_Processor::get_tag() namespace aware.
The HTML specification indicates that an HTML tag with the name "IMAGE" should be renamed as "IMG" and handled as if it were an "IMG", but this only applies to elements in the HTML namespace. In this patch the HTML Processor is updated to ensure that it doesn't remap the tag name when processing foreign content, such as SVG and MathML markup. Developed in https://github.com/wordpress/wordpress-develop/7330 Discussed in https://core.trac.wordpress.org/ticket/61656 Props dmsnell, jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@59014 git-svn-id: http://core.svn.wordpress.org/trunk@58410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1d71540320
commit
7d9bb7efd3
|
@ -4727,17 +4727,13 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
|
||||||
|
|
||||||
$tag_name = parent::get_tag();
|
$tag_name = parent::get_tag();
|
||||||
|
|
||||||
switch ( $tag_name ) {
|
/*
|
||||||
case 'IMAGE':
|
* > A start tag whose tag name is "image"
|
||||||
/*
|
* > Change the token's tag name to "img" and reprocess it. (Don't ask.)
|
||||||
* > A start tag whose tag name is "image"
|
*/
|
||||||
* > Change the token's tag name to "img" and reprocess it. (Don't ask.)
|
return ( 'IMAGE' === $tag_name && 'html' === $this->get_namespace() )
|
||||||
*/
|
? 'IMG'
|
||||||
return 'IMG';
|
: $tag_name;
|
||||||
|
|
||||||
default:
|
|
||||||
return $tag_name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.7-alpha-59013';
|
$wp_version = '6.7-alpha-59014';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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