Changeset 28718
- Timestamp:
- 06/10/2014 02:08:05 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r28717 r28718 80 80 } 81 81 82 $static_characters = array_merge( array( '---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)' ), $cockney );83 $static_replacements = array_merge( array( $em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace );82 $static_characters = array_merge( array( '---', '...', '``', '\'\'', ' (tm)' ), $cockney ); 83 $static_replacements = array_merge( array( $em_dash, '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); 84 84 85 85 $spaces = wp_spaces_regexp(); … … 128 128 $dynamic[ '/\'(?=\Z|\.|' . $spaces . ')/' ] = $closing_single_quote; 129 129 } 130 131 // Dashes and spaces 132 $dynamic[ '/(?<=' . $spaces . ')--(?=' . $spaces . ')/' ] = $em_dash; 133 $dynamic[ '/(?<!xn)--/' ] = $en_dash; 134 $dynamic[ '/(?<=' . $spaces . ')-(?=' . $spaces . ')/' ] = $en_dash; 130 135 131 136 $dynamic_characters = array_keys( $dynamic ); -
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r27839 r28718 188 188 */ 189 189 function test_spaces_around_hyphens() { 190 $nbsp = "\xC2\xA0"; 191 190 192 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 191 193 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 192 194 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 193 195 $this->assertEquals( ' – ', wptexturize( ' - ') ); 196 $this->assertEquals( "$nbsp–$nbsp", wptexturize( "$nbsp-$nbsp" ) ); 197 $this->assertEquals( " –$nbsp", wptexturize( " -$nbsp" ) ); 198 $this->assertEquals( "$nbsp– ", wptexturize( "$nbsp- ") ); 194 199 195 200 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); … … 197 202 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); 198 203 $this->assertEquals( ' — ', wptexturize( ' -- ') ); 204 $this->assertEquals( "$nbsp—$nbsp", wptexturize( "$nbsp--$nbsp" ) ); 205 $this->assertEquals( " —$nbsp", wptexturize( " --$nbsp" ) ); 206 $this->assertEquals( "$nbsp— ", wptexturize( "$nbsp-- ") ); 199 207 } 200 208 … … 930 938 array( 931 939 "word xn– word", 932 "word xn --word",940 "word xn– word", 933 941 ), 934 942 array( 935 943 "wordxn–word", 944 "wordxn–word", 945 ), 946 array( 947 "wordxn--word", 936 948 "wordxn--word", 937 949 ),
Note: See TracChangeset
for help on using the changeset viewer.