diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index fa9551a3e4..640e136fcf 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -596,7 +596,9 @@ function wpautop( $pee, $br = true ) { $pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee); // Restore newlines in all elements. - $pee = str_replace( " ", "\n", $pee ); + if ( false !== strpos( $pee, '' ) ) { + $pee = str_replace( array( ' ', '' ), "\n", $pee ); + } return $pee; }