Make WordPress Core


Ignore:
Timestamp:
01/16/2015 03:54:00 AM (9 years ago)
Author:
pento
Message:

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

Fixes #31030

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r31186 r31199  
    175175        // Dashes and spaces
    176176        $dynamic[ '/---/' ] = $em_dash;
    177         $dynamic[ '/(?<=' . $spaces . ')--(?=' . $spaces . ')/' ] = $em_dash;
     177        $dynamic[ '/(?<=^|' . $spaces . ')--(?=$|' . $spaces . ')/' ] = $em_dash;
    178178        $dynamic[ '/(?<!xn)--/' ] = $en_dash;
    179         $dynamic[ '/(?<=' . $spaces . ')-(?=' . $spaces . ')/' ] = $en_dash;
     179        $dynamic[ '/(?<=^|' . $spaces . ')-(?=$|' . $spaces . ')/' ] = $en_dash;
    180180
    181181        $dynamic_characters['dash'] = array_keys( $dynamic );
Note: See TracChangeset for help on using the changeset viewer.