Formatting: Add 'main' tag to kses

`main` is a valid HTML element that is especially valuable for KSES to support in light of full site editing.

Related: https://github.com/WordPress/gutenberg/pull/28576 for the addition of `main` to the group block.

Fixes #53156.
Props glendaviesnz.



git-svn-id: https://develop.svn.wordpress.org/trunk@50987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Aaron Jorbin
2021-05-25 01:42:20 +00:00
parent d80fdbca3b
commit 84eee38fcb
2 changed files with 24 additions and 0 deletions

View File

@@ -252,6 +252,12 @@ if ( ! CUSTOM_TAGS ) {
'align' => true,
'value' => true,
),
'main' => array(
'align' => true,
'dir' => true,
'lang' => true,
'xml:lang' => true,
),
'map' => array(
'name' => true,
),

View File

@@ -1478,4 +1478,22 @@ EOF;
$this->assertSame( $html, wp_kses_post( $html ) );
}
/**
* Test filtering a standard main tag.
*
* @ticket 53156
*/
function test_wp_kses_main_tag_standard_attributes() {
$test = array(
'<main',
'class="wp-group-block"',
'style="padding:10px"',
'/>',
);
$html = implode( ' ', $test );
$this->assertSame( $html, wp_kses_post( $html ) );
}
}