Fix whitespace issues in [29781]. Remove a redundant comment.
props miqrogroove. see #29557. Built from https://develop.svn.wordpress.org/trunk@29873 git-svn-id: http://core.svn.wordpress.org/trunk@29632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
471dc2022f
commit
20cfcbf86d
|
@ -205,33 +205,33 @@ function wptexturize($text, $reset = false) {
|
||||||
|
|
||||||
// Look for shortcodes and HTML elements.
|
// Look for shortcodes and HTML elements.
|
||||||
|
|
||||||
$comment_regex =
|
$comment_regex =
|
||||||
'!' // Start of comment, after the <.
|
'!' // Start of comment, after the <.
|
||||||
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
||||||
. '-(?!->)' // Dash not followed by end of comment.
|
. '-(?!->)' // Dash not followed by end of comment.
|
||||||
. '[^\-]*+' // Consume non-dashes.
|
. '[^\-]*+' // Consume non-dashes.
|
||||||
. ')*+' // Loop possessively.
|
. ')*+' // Loop possessively.
|
||||||
. '(?:-->)?'; // End of comment. If not found, match all input.
|
. '(?:-->)?'; // End of comment. If not found, match all input.
|
||||||
|
|
||||||
$shortcode_regex =
|
$shortcode_regex =
|
||||||
'\[' // Find start of shortcode.
|
'\[' // Find start of shortcode.
|
||||||
. '[\/\[]?' // Shortcodes may begin with [/ or [[
|
. '[\/\[]?' // Shortcodes may begin with [/ or [[
|
||||||
. '[^\s\/\[\]]' // No whitespace before name.
|
. '[^\s\/\[\]]' // No whitespace before name.
|
||||||
. '[^\[\]]*+' // Shortcodes do not contain other shortcodes. Possessive critical.
|
. '[^\[\]]*+' // Shortcodes do not contain other shortcodes. Possessive critical.
|
||||||
. '\]' // Find end of shortcode.
|
. '\]' // Find end of shortcode.
|
||||||
. '\]?'; // Shortcodes may end with ]]
|
. '\]?'; // Shortcodes may end with ]]
|
||||||
|
|
||||||
$regex =
|
$regex =
|
||||||
'/(' // Capture the entire match.
|
'/(' // Capture the entire match.
|
||||||
. '<' // Find start of element.
|
. '<' // Find start of element.
|
||||||
. '(?(?=!--)' // Is this a comment?
|
. '(?(?=!--)' // Is this a comment?
|
||||||
. $comment_regex // Find end of comment.
|
. $comment_regex // Find end of comment.
|
||||||
. '|'
|
. '|'
|
||||||
. '[^>]+>' // Find end of element.
|
. '[^>]+>' // Find end of element.
|
||||||
. ')'
|
. ')'
|
||||||
. '|'
|
. '|'
|
||||||
. $shortcode_regex // Find shortcodes.
|
. $shortcode_regex // Find shortcodes.
|
||||||
. ')/s';
|
. ')/s';
|
||||||
|
|
||||||
$textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
|
$textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
|
||||||
|
|
||||||
|
@ -261,8 +261,6 @@ function wptexturize($text, $reset = false) {
|
||||||
_wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );
|
_wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );
|
||||||
} else {
|
} else {
|
||||||
// Looks like an escaped shortcode.
|
// Looks like an escaped shortcode.
|
||||||
// Do not texturize.
|
|
||||||
// Do not push to the shortcodes stack.
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue