Changeset 32789
- Timestamp:
- 06/16/2015 12:49:45 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r32788 r32789 128 128 // '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation. 129 129 if ( "'" !== $apos || "'" !== $closing_single_quote ) { 130 $dynamic[ '/\'(\d\d)\'(?=\Z|[., )}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;130 $dynamic[ '/\'(\d\d)\'(?=\Z|[.,:;!?)}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote; 131 131 } 132 132 if ( "'" !== $apos || '"' !== $closing_quote ) { 133 $dynamic[ '/\'(\d\d)"(?=\Z|[., )}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;133 $dynamic[ '/\'(\d\d)"(?=\Z|[.,:;!?)}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote; 134 134 } 135 135 … … 151 151 // Apostrophe in a word. No spaces, double apostrophes, or other punctuation. 152 152 if ( "'" !== $apos ) { 153 $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:; "\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos;153 $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;!?"\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos; 154 154 } 155 155 … … 161 161 // Single quotes followed by spaces or ending punctuation. 162 162 if ( "'" !== $closing_single_quote ) { 163 $dynamic[ '/\'(?=\Z|[., )}\-\]]|>|' . $spaces . ')/' ] = $closing_single_quote;163 $dynamic[ '/\'(?=\Z|[.,:;!?)}\-\]]|>|' . $spaces . ')/' ] = $closing_single_quote; 164 164 } 165 165 -
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r32788 r32789 113 113 $this->assertEquals('Class of ’99’s', wptexturize("Class of '99's")); 114 114 $this->assertEquals('‘Class of ’99’', wptexturize("'Class of '99'")); 115 $this->assertEquals('‘Class of ’99’ ', wptexturize("'Class of '99' ")); 116 $this->assertEquals('‘Class of ’99’.', wptexturize("'Class of '99'.")); 117 $this->assertEquals('‘Class of ’99’, she said', wptexturize("'Class of '99', she said")); 118 $this->assertEquals('‘Class of ’99’:', wptexturize("'Class of '99':")); 119 $this->assertEquals('‘Class of ’99’;', wptexturize("'Class of '99';")); 120 $this->assertEquals('‘Class of ’99’!', wptexturize("'Class of '99'!")); 121 $this->assertEquals('‘Class of ’99’?', wptexturize("'Class of '99'?")); 115 122 $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99's'")); 116 123 $this->assertEquals('‘Class of ’99’s’', wptexturize("'Class of '99’s'")); … … 119 126 $this->assertEquals('{“Class of ’99”}', wptexturize("{\"Class of '99\"}")); 120 127 $this->assertEquals(' “Class of ’99” ', wptexturize(" \"Class of '99\" ")); 128 $this->assertEquals(' “Class of ’99”.', wptexturize(" \"Class of '99\".")); 129 $this->assertEquals(' “Class of ’99”, she said', wptexturize(" \"Class of '99\", she said")); 130 $this->assertEquals(' “Class of ’99”:', wptexturize(" \"Class of '99\":")); 131 $this->assertEquals(' “Class of ’99”;', wptexturize(" \"Class of '99\";")); 132 $this->assertEquals(' “Class of ’99”!', wptexturize(" \"Class of '99\"!")); 133 $this->assertEquals(' “Class of ’99”?', wptexturize(" \"Class of '99\"?")); 121 134 $this->assertEquals('}”Class of ’99″{', wptexturize("}\"Class of '99\"{")); // Not a quotation, may be between two other quotations. 122 135 } … … 703 716 ), 704 717 array( 718 'test sentence",', 719 'test sentence”,', 720 ), 721 array( 722 'test sentence":', 723 'test sentence”:', 724 ), 725 array( 726 'test sentence";', 727 'test sentence”;', 728 ), 729 array( 730 'test sentence"!', 731 'test sentence”!', 732 ), 733 array( 734 'test sentence"?', 735 'test sentence”?', 736 ), 737 array( 705 738 'test sentence."', 706 739 'test sentence.”', … … 746 779 "word word', she said", 747 780 "word word’, she said", 781 ), 782 array( 783 "word word': word", 784 "word word’: word", 785 ), 786 array( 787 "word word'; word", 788 "word word’; word", 789 ), 790 array( 791 "word word'! word", 792 "word word’! word", 793 ), 794 array( 795 "word word'? word", 796 "word word’? word", 748 797 ), 749 798 array(
Note: See TracChangeset
for help on using the changeset viewer.