Ticket #4539: 4539.diff
File 4539.diff, 2.9 KB (added by , 11 years ago) |
---|
-
src/wp-includes/formatting.php
124 124 $dynamic[ '/(?<=\A|' . $spaces . ')\'(\d[.,\d]*)\'/' ] = $opening_single_quote . '$1' . $closing_single_quote; 125 125 } 126 126 127 // Quoted string ending with a number 128 if ( '"' !== $opening_quote && '"' !== $closing_quote ) { 129 $dynamic[ '/(?<!\d)"(.*?\d[.,\d]*)"/' ] = $opening_quote . '$1' . $closing_quote; 130 } 131 if ( "'" !== $opening_single_quote && "'" !== $closing_single_quote ) { 132 $dynamic[ "/(?<!\d)'(.*?\d[.,\d]*)'/" ] = $opening_single_quote . '$1' . $closing_single_quote; 133 } 134 127 135 // Single quote at start, or preceded by (, {, <, [, ", -, or spaces. 128 136 if ( "'" !== $opening_single_quote ) { 129 137 $dynamic[ '/(?<=\A|[([{<"\-]|' . $spaces . ')\'/' ] = $opening_single_quote; -
tests/phpunit/tests/formatting/WPTexturize.php
91 91 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”… and ellipses.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"... and ellipses.')); 92 92 //$this->assertEquals('Here is “a test <a href="http://example.com">with a link</a>”.', wptexturize('Here is "a test <a href="http://example.com">with a link</a>".')); 93 93 //$this->assertEquals('Here is “<a href="http://example.com">a test with a link</a>”and a work stuck to the end.', wptexturize('Here is "<a href="http://example.com">a test with a link</a>"and a work stuck to the end.')); 94 //$this->assertEquals('A test with a finishing number, “like 23”.', wptexturize('A test with a finishing number, "like 23".'));95 //$this->assertEquals('A test with a number, “like 62”, is nice to have.', wptexturize('A test with a number, "like 62", is nice to have.'));94 $this->assertEquals('A test with a finishing number, “like 23”.', wptexturize('A test with a finishing number, "like 23".')); 95 $this->assertEquals('A test with a number, “like 62”, is nice to have.', wptexturize('A test with a number, "like 62", is nice to have.')); 96 96 } 97 97 98 98 /** … … 119 119 $this->assertEquals('“Class of ’99”', wptexturize("\"Class of '99\"")); 120 120 } 121 121 122 /** 123 * @ticket 4539 124 */ 122 125 function test_quotes_after_numbers() { 123 $this->assertEquals('Class of ’99', wptexturize("Class of '99")); 126 $this->assertEquals('Class of 99′', wptexturize("Class of 99'")); 127 $this->assertEquals('‘Class of 99’', wptexturize("'Class of 99'")); 128 $this->assertEquals('“Class of 99”', wptexturize('"Class of 99"')); 124 129 } 125 130 126 131 /**