`wptexturize()` should handle apostrophes before primes.

Props nacin, miqrogroove.
Fixes #22823.

Built from https://develop.svn.wordpress.org/trunk@28725


git-svn-id: http://core.svn.wordpress.org/trunk@28539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-06-10 14:14:17 +00:00
parent 5755eaf372
commit 3d3c166f11
1 changed files with 5 additions and 5 deletions

View File

@ -118,6 +118,11 @@ function wptexturize($text) {
$dynamic[ '/(?<=\A|[([{<"]|' . $spaces . ')\'/' ] = $opening_single_quote;
}
// Apostrophe in a word. No spaces or double apostrophes.
if ( "'" != $apos ) {
$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|\'|' . $spaces . ')/' ] = $apos;
}
// 9" (double prime)
if ( '"' !== $double_prime ) {
$dynamic[ '/(?<=\d)"/' ] = $double_prime;
@ -128,11 +133,6 @@ function wptexturize($text) {
$dynamic[ '/(?<=\d)\'/' ] = $prime;
}
// Apostrophe in a word. No spaces or double primes.
if ( "'" !== $apos ) {
$dynamic[ '/(?<!' . $spaces . ')\'(?!\'|' . $spaces . ')/' ] = $apos;
}
// Double quote at start, or preceded by (, {, <, [, or spaces, and not followed by spaces.
if ( '"' !== $opening_quote ) {
$dynamic[ '/(?<=\A|[([{<]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;