diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 41cad82806..633085530c 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -582,7 +582,7 @@ function wpautop( $pee, $br = true ) { $pee = preg_replace( '#(<(' . $allblocksexceptp . ')[^>]*>)(((?!

|).)*)

#s', '$1$3', $pee ); // If an opening

tag is inside a block element tag, without a following closing

tag, remove it. - $pee = preg_replace( '#

(((?!

).)*)#s', '$1', $pee ); + $pee = preg_replace( '#

([^<]*(((?!

).)*))#s', '$1', $pee ); // Optionally insert line breaks. if ( $br ) {