mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-24 00:11:41 +01:00
Fix texturization of quotes when enclosed by angle brackets.
props miqrogroove. fixes #28718. Built from https://develop.svn.wordpress.org/trunk@28971 git-svn-id: http://core.svn.wordpress.org/trunk@28760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2f344b9d3c
commit
c6c1f56d60
@ -104,11 +104,10 @@ function wptexturize($text, $reset = false) {
|
|||||||
|
|
||||||
// '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation.
|
// '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation.
|
||||||
if ( "'" !== $apos || "'" !== $closing_single_quote ) {
|
if ( "'" !== $apos || "'" !== $closing_single_quote ) {
|
||||||
$dynamic[ '/\'(\d\d)\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;
|
$dynamic[ '/\'(\d\d)\'(?=\Z|[.,)}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_single_quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( "'" !== $apos || '"' !== $closing_quote ) {
|
if ( "'" !== $apos || '"' !== $closing_quote ) {
|
||||||
$dynamic[ '/\'(\d\d)"(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;
|
$dynamic[ '/\'(\d\d)"(?=\Z|[.,)}\-\]]|>|' . $spaces . ')/' ] = $apos . '$1' . $closing_quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// '99 '99s '99's (apostrophe) But never '9 or '99% or '999 or '99.0.
|
// '99 '99s '99's (apostrophe) But never '9 or '99% or '999 or '99.0.
|
||||||
@ -126,12 +125,12 @@ function wptexturize($text, $reset = false) {
|
|||||||
|
|
||||||
// Single quote at start, or preceded by (, {, <, [, ", -, or spaces.
|
// Single quote at start, or preceded by (, {, <, [, ", -, or spaces.
|
||||||
if ( "'" !== $opening_single_quote ) {
|
if ( "'" !== $opening_single_quote ) {
|
||||||
$dynamic[ '/(?<=\A|[([{<"\-]|' . $spaces . ')\'/' ] = $opening_single_quote;
|
$dynamic[ '/(?<=\A|[([{"\-]|<|' . $spaces . ')\'/' ] = $opening_single_quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apostrophe in a word. No spaces, double apostrophes, or other punctuation.
|
// Apostrophe in a word. No spaces, double apostrophes, or other punctuation.
|
||||||
if ( "'" !== $apos ) {
|
if ( "'" !== $apos ) {
|
||||||
$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}<>[\]\-]|' . $spaces . ')/' ] = $apos;
|
$dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;"\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9" (double prime)
|
// 9" (double prime)
|
||||||
@ -146,7 +145,7 @@ function wptexturize($text, $reset = false) {
|
|||||||
|
|
||||||
// Double quote at start, or preceded by (, {, <, [, -, or spaces, and not followed by spaces.
|
// Double quote at start, or preceded by (, {, <, [, -, or spaces, and not followed by spaces.
|
||||||
if ( '"' !== $opening_quote ) {
|
if ( '"' !== $opening_quote ) {
|
||||||
$dynamic[ '/(?<=\A|[([{<\-]|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
|
$dynamic[ '/(?<=\A|[([{\-]|<|' . $spaces . ')"(?!' . $spaces . ')/' ] = $opening_quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Any remaining double quotes.
|
// Any remaining double quotes.
|
||||||
@ -156,7 +155,7 @@ function wptexturize($text, $reset = false) {
|
|||||||
|
|
||||||
// Single quotes followed by spaces or ending punctuation.
|
// Single quotes followed by spaces or ending punctuation.
|
||||||
if ( "'" !== $closing_single_quote ) {
|
if ( "'" !== $closing_single_quote ) {
|
||||||
$dynamic[ '/\'(?=\Z|[.,)}>\-\]]|' . $spaces . ')/' ] = $closing_single_quote;
|
$dynamic[ '/\'(?=\Z|[.,)}\-\]]|>|' . $spaces . ')/' ] = $closing_single_quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dashes and spaces
|
// Dashes and spaces
|
||||||
|
Loading…
Reference in New Issue
Block a user