diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 74537c1065..762637a320 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -235,7 +235,7 @@ function wptexturize($text, $reset = false) { . '(?(?=!--)' // Is this a comment? . $comment_regex // Find end of comment. . '|' - . '[^>]+>' // Find end of element. + . '[^>]*>' // Find end of element. . ')' . '|' . $shortcode_regex // Find shortcodes. diff --git a/tests/phpunit/tests/formatting/WPTexturize.php b/tests/phpunit/tests/formatting/WPTexturize.php index f69260322f..0eb08e2ed4 100644 --- a/tests/phpunit/tests/formatting/WPTexturize.php +++ b/tests/phpunit/tests/formatting/WPTexturize.php @@ -1393,6 +1393,18 @@ class Tests_Formatting_WPTexturize extends WP_UnitTestCase { '[Let\'s get crazy[caption code="hello"]world]', // caption shortcode is invalid here because it contains [] chars. '[Let’s get crazy[caption code=”hello“]world]', ), + array( + '<> ... <>', + '<> … <>', + ), + array( + '<> ... <> ... >', + '<> … <> … >', + ), + array( + '<> ... < ... > ... <>', + '<> … < ... > … <>', + ), ); }