Make WordPress Core

Changeset 28721

Timestamp:
06/10/2014 02:42:35 AM (10 years ago)
Author:
wonderboymusic
Message:

Fix curly quotes around numbers when applicable.

Adds unit tests.

Props filosofo, mrmist, aliso, MikeHansenMe, miqrogroove.
Fixes #8775.

Location:
trunk
Files:
2 edited

Legend:

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

    r28719 r28721  
    8888        // Pattern-based replacements of characters.
    8989        $dynamic = array();
     90
     91
     92
     93
     94
     95
     96
     97
    9098
    9199        // '99 '99s '99's (apostrophe)
  • trunk/tests/phpunit/tests/formatting/WPTexturize.php

    r28719 r28721  
    155155        $this->assertEquals('“12345”', wptexturize('"12345"'));
    156156        $this->assertEquals('‘12345’', wptexturize('\'12345\''));
    157         $this->assertEquals('“a 9′ plus a ‘9’, maybe a 9′ ‘9’ ”', wptexturize('"a 9\' plus a \'9\', maybe a 9\' \'9\' "'));
    158         $this->assertEquals('<p>&#8216;99<br />&#8216;123&#8217;<br />&#8217;tis<br />&#8216;s&#8217;</p>', wptexturize('<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>'));
     157        $this->assertEquals('&#8220;a 9&#8242; plus a &#8216;9&#8217;, maybe a 9&#8242; &#8216;9&#8217;"'));
     158        $this->assertEquals('<p>&#821;99<br />&#8216;123&#8217;<br />&#8217;tis<br />&#8216;s&#8217;</p>', wptexturize('<p>\'99<br />\'123\'<br />\'tis<br />\'s\'</p>'));
    159159    }
    160160
     
    314314            ),
    315315            array(
    316                 "word '99's word", // Due to the logic error, second apos becomes a prime.  See ticket #22823
    317                 "word &#8217;99&#8242;s word",
    318             ),
    319             array(
    320                 "word '99'samsonite",
    321                 "word &#8217;99&#8242;samsonite",
    322             ),
    323             array(
    324316                "according to our source, '33% of all students scored less than 50' on the test.", // Apostrophes and primes have priority over quotes
    325317                "according to our source, &#8217;33% of all students scored less than 50&#8242; on the test.",
    326318            ),
    327             array(
    328                 "word '99' word", // See ticket #8775
    329                 "word &#8217;99&#8242; word",
    330             ),
    331319        );
    332320    }
     
    10271015        );
    10281016    }
     1017
     1018
     1019
     1020
     1021
     1022
     1023
     1024
     1025
     1026
     1027
     1028
     1029
     1030
     1031
     1032
     1033
     1034
     1035
     1036
     1037
     1038
     1039
     1040
     1041
     1042
     1043
     1044
     1045
     1046
     1047
     1048
     1049
     1050
     1051
     1052
     1053
     1054
     1055
     1056
     1057
     1058
     1059
     1060
     1061
     1062
     1063
     1064
     1065
     1066
     1067
     1068
    10291069}
Note: See TracChangeset for help on using the changeset viewer.