WordPress.org

Make WordPress Core

Changeset 28725


Ignore:
Timestamp:
06/10/2014 02:13:52 PM (7 years ago)
Author:
wonderboymusic
Message:

wptexturize() should handle apostrophes before primes.

Props nacin, miqrogroove.
Fixes #22823.

Location:
trunk
Files:
2 edited

Legend:

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

    r28724 r28725  
    119119        }
    120120
     121        // Apostrophe in a word.  No spaces or double apostrophes.
     122        if ( "'" != $apos ) {
     123            $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|\'|' . $spaces . ')/' ] = $apos;
     124        }
     125
    121126        // 9" (double prime)
    122127        if ( '"' !== $double_prime ) {
     
    127132        if ( "'" !== $prime ) {
    128133            $dynamic[ '/(?<=\d)\'/' ] = $prime;
    129         }
    130 
    131         // Apostrophe in a word.  No spaces or double primes.
    132         if ( "'" !== $apos ) {
    133             $dynamic[ '/(?<!' . $spaces . ')\'(?!\'|' . $spaces . ')/' ] = $apos;
    134134        }
    135135
  • trunk/tests/phpunit/tests/formatting/WPTexturize.php

    r28721 r28725  
    501501            ),
    502502            array(
    503                 "word 99'word",
    504                 "word 99&#8242;word",
     503                "word 99'word", // Not a prime anymore. Apostrophes get priority.
     504                "word 99&#8217;word",
    505505            ),
    506506            array(
     
    509509            ),
    510510            array(
    511                 "word99'word",
    512                 "word99&#8242;word",
     511                "word99'word", // Not a prime anymore.
     512                "word99&#8217;word",
    513513            ),
    514514        );
Note: See TracChangeset for help on using the changeset viewer.