Ticket #20342: 20342.4.diff
File 20342.4.diff, 2.7 KB (added by , 11 years ago) |
---|
-
src/wp-includes/formatting.php
79 79 $dynamic[ '/\'(\d)/' ] = $apos . '$1'; // '99 80 80 } 81 81 if ( "'" != $opening_single_quote ) 82 $dynamic[ '/(\s|\A|[([{< ]|")\'/' ] = '$1' . $opening_single_quote; // opening single quote, even after (, {, <, [82 $dynamic[ '/(\s|\A|[([{<;]|")\'/' ] = '$1' . $opening_single_quote; // opening single quote, even after (, {, <, [, ; 83 83 if ( '"' != $double_prime ) 84 84 $dynamic[ '/(\d)"/' ] = '$1' . $double_prime; // 9" (double prime) 85 85 if ( "'" != $prime ) … … 87 87 if ( "'" != $apos ) 88 88 $dynamic[ '/(\S)\'([^\'\s])/' ] = '$1' . $apos . '$2'; // apostrophe in a word 89 89 if ( '"' != $opening_quote ) 90 $dynamic[ '/(\s|\A|[([{< ])"(?!\s)/' ] = '$1' . $opening_quote . '$2'; // opening double quote, even after (, {, <, [90 $dynamic[ '/(\s|\A|[([{<;])"(?!\s)/' ] = '$1' . $opening_quote . '$2'; // opening double quote, even after (, {, <, [, ; 91 91 if ( '"' != $closing_quote ) 92 92 $dynamic[ '/"(\s|\S|\Z)/' ] = $closing_quote . '$1'; // closing double quote 93 93 if ( "'" != $closing_single_quote ) -
tests/phpunit/tests/formatting/WPTexturize.php
184 184 * @ticket 23185 185 185 */ 186 186 function test_spaces_around_hyphens() { 187 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 187 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 188 188 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 189 189 $this->assertEquals( ' – ', wptexturize( ' - ' ) ); 190 190 $this->assertEquals( ' – ', wptexturize( ' - ') ); 191 191 192 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); 192 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); 193 193 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); 194 194 $this->assertEquals( ' — ', wptexturize( ' -- ' ) ); 195 195 $this->assertEquals( ' — ', wptexturize( ' -- ') ); 196 196 } 197 198 /** 199 * @ticket 20342 200 */ 201 function test_quotes_after_emdash() { 202 $this->assertEquals( '<p>I also remember the line in “Casey at the Bat” when he struck out—“There is no Joy in Mudville!!!”</p>', wptexturize( '<p>I also remember the line in "Casey at the Bat" when he struck out---"There is no Joy in Mudville!!!"</p>' ) ); 203 } 197 204 }