Make WordPress Core

Ticket #20342: 20342.4.diff

File 20342.4.diff, 2.7 KB (added by adamsilverstein, 10 years ago)

don't breat other tests!

  • src/wp-includes/formatting.php

     
    7979                        $dynamic[ '/\'(\d)/'                   ] = $apos . '$1'; // '99
    8080                }
    8181                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 (, {, <, [, ;
    8383                if ( '"' != $double_prime )
    8484                        $dynamic[ '/(\d)"/'                    ] = '$1' . $double_prime; // 9" (double prime)
    8585                if ( "'" != $prime )
     
    8787                if ( "'" != $apos )
    8888                        $dynamic[ '/(\S)\'([^\'\s])/'          ] = '$1' . $apos . '$2'; // apostrophe in a word
    8989                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 (, {, <, [, ;
    9191                if ( '"' != $closing_quote )
    9292                        $dynamic[ '/"(\s|\S|\Z)/'              ] = $closing_quote . '$1'; // closing double quote
    9393                if ( "'" != $closing_single_quote )
  • tests/phpunit/tests/formatting/WPTexturize.php

     
    184184         * @ticket 23185
    185185         */
    186186        function test_spaces_around_hyphens() {
    187                 $this->assertEquals( ' &#8211; ', wptexturize( ' - ' ) ); 
     187                $this->assertEquals( ' &#8211; ', wptexturize( ' - ' ) );
    188188                $this->assertEquals( '&nbsp;&#8211;&nbsp;', wptexturize( '&nbsp;-&nbsp;' ) );
    189189                $this->assertEquals( ' &#8211;&nbsp;', wptexturize( ' -&nbsp;' ) );
    190190                $this->assertEquals( '&nbsp;&#8211; ', wptexturize( '&nbsp;- ') );
    191191
    192                 $this->assertEquals( ' &#8212; ', wptexturize( ' -- ' ) ); 
     192                $this->assertEquals( ' &#8212; ', wptexturize( ' -- ' ) );
    193193                $this->assertEquals( '&nbsp;&#8212;&nbsp;', wptexturize( '&nbsp;--&nbsp;' ) );
    194194                $this->assertEquals( ' &#8212;&nbsp;', wptexturize( ' --&nbsp;' ) );
    195195                $this->assertEquals( '&nbsp;&#8212; ', wptexturize( '&nbsp;-- ') );
    196196        }
     197
     198        /**
     199         * @ticket 20342
     200         */
     201        function test_quotes_after_emdash() {
     202                $this->assertEquals( '<p>I also remember the line in &#8220;Casey at the Bat&#8221; when he struck out&#8212;&#8220;There is no Joy in Mudville!!!&#8221;</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        }
    197204}