diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index a36129767f..3086a092e8 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -79,8 +79,8 @@ function wptexturize($text) { $cockney = $cockneyreplace = array(); } - $static_characters = array_merge( array( '---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)' ), $cockney ); - $static_replacements = array_merge( array( $em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); + $static_characters = array_merge( array( '---', '...', '``', '\'\'', ' (tm)' ), $cockney ); + $static_replacements = array_merge( array( $em_dash, '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); $spaces = wp_spaces_regexp(); @@ -128,6 +128,11 @@ function wptexturize($text) { $dynamic[ '/\'(?=\Z|\.|' . $spaces . ')/' ] = $closing_single_quote; } + // Dashes and spaces + $dynamic[ '/(?<=' . $spaces . ')--(?=' . $spaces . ')/' ] = $em_dash; + $dynamic[ '/(?