When a hyphen - or double hyphen -- was at the start or the end of a string, it wasn't texturized correctly.

Fixes #31030



git-svn-id: https://develop.svn.wordpress.org/trunk@31199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2015-01-16 03:54:00 +00:00
parent d266ecd5b2
commit c8c8b66bae
2 changed files with 15 additions and 2 deletions

View File

@@ -174,9 +174,9 @@ function wptexturize($text, $reset = false) {
// Dashes and spaces
$dynamic[ '/---/' ] = $em_dash;
$dynamic[ '/(?<=' . $spaces . ')--(?=' . $spaces . ')/' ] = $em_dash;
$dynamic[ '/(?<=^|' . $spaces . ')--(?=$|' . $spaces . ')/' ] = $em_dash;
$dynamic[ '/(?<!xn)--/' ] = $en_dash;
$dynamic[ '/(?<=' . $spaces . ')-(?=' . $spaces . ')/' ] = $en_dash;
$dynamic[ '/(?<=^|' . $spaces . ')-(?=$|' . $spaces . ')/' ] = $en_dash;
$dynamic_characters['dash'] = array_keys( $dynamic );
$dynamic_replacements['dash'] = array_values( $dynamic );