diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 38a4a113a9..c524b06928 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2514,9 +2514,9 @@ function force_balance_tags( $text ) { $tagqueue = ''; $newtext = ''; // Known single-entity/self-closing tags. - $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' ); + $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source', 'track', 'wbr' ); // Tags that can be immediately nested within themselves. - $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' ); + $nestable_tags = array( 'article', 'aside', 'blockquote', 'details', 'div', 'figure', 'object', 'q', 'section', 'span' ); // WP bug fix for comments - in case you REALLY meant to type '< !--'. $text = str_replace( '< !--', '< !--', $text ); diff --git a/tests/phpunit/tests/formatting/balanceTags.php b/tests/phpunit/tests/formatting/balanceTags.php index 4726cf24db..11740c98a3 100644 --- a/tests/phpunit/tests/formatting/balanceTags.php +++ b/tests/phpunit/tests/formatting/balanceTags.php @@ -7,10 +7,15 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { public function nestable_tags() { return array( + array( 'article' ), + array( 'aside' ), array( 'blockquote' ), + array( 'details' ), array( 'div' ), + array( 'figure' ), array( 'object' ), array( 'q' ), + array( 'section' ), array( 'span' ), ); } @@ -34,6 +39,8 @@ class Tests_Formatting_BalanceTags extends WP_UnitTestCase { array( 'meta' ), array( 'param' ), array( 'source' ), + array( 'track' ), + array( 'wbr' ), ); }