Changeset 30449 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 11/20/2014 02:27:08 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r30383 r30449 29 29 */ 30 30 function wptexturize($text, $reset = false) { 31 global $wp_cockneyreplace ;31 global $wp_cockneyreplace, $shortcode_tags; 32 32 static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements, 33 33 $default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true; … … 206 206 // Look for shortcodes and HTML elements. 207 207 208 $tagnames = array_keys( $shortcode_tags ); 209 $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); 210 $tagregexp = "(?:$tagregexp)(?![\\w-])"; // Excerpt of get_shortcode_regex(). 211 208 212 $comment_regex = 209 213 '!' // Start of comment, after the <. … … 215 219 216 220 $shortcode_regex = 217 '\[' // Find start of shortcode. 218 . '[\/\[]?' // Shortcodes may begin with [/ or [[ 219 . '[^\s\/\[\]]' // No whitespace before name. 220 . '[^\[\]]*+' // Shortcodes do not contain other shortcodes. Possessive critical. 221 . '\]' // Find end of shortcode. 222 . '\]?'; // Shortcodes may end with ]] 221 '\[' // Find start of shortcode. 222 . '[\/\[]?' // Shortcodes may begin with [/ or [[ 223 . $tagregexp // Only match registered shortcodes, because performance. 224 . '(?:' 225 . '[^\[\]<>]+' // Shortcodes do not contain other shortcodes. Quantifier critical. 226 . '|' 227 . '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >. 228 . ')*+' // Possessive critical. 229 . '\]' // Find end of shortcode. 230 . '\]?'; // Shortcodes may end with ]] 223 231 224 232 $regex =
Note: See TracChangeset
for help on using the changeset viewer.