Ticket #15556: 15556.2.patch
File 15556.2.patch, 2.2 KB (added by , 15 years ago) |
---|
-
wp-includes/formatting.php
28 28 */ 29 29 function wptexturize($text) { 30 30 global $wp_cockneyreplace; 31 static $static_setup = false, $opening_quote, $closing_quote, $ default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;31 static $static_setup = false, $opening_quote, $closing_quote, $en_dash, $em_dash, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements; 32 32 $output = ''; 33 33 $curl = ''; 34 34 $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); … … 40 40 $opening_quote = _x('“', 'opening curly quote'); 41 41 /* translators: closing curly quote */ 42 42 $closing_quote = _x('”', 'closing curly quote'); 43 /* translators: en dash */ 44 $en_dash = _x('–', 'en dash'); 45 /* translators: em dash */ 46 $em_dash = _x('—', 'em dash'); 43 47 44 48 $default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt'); 45 49 $default_no_texturize_shortcodes = array('code'); … … 54 58 } 55 59 56 60 $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney); 57 $static_replacements = array_merge(array( '—', ' — ', '–', ' –', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace);61 $static_replacements = array_merge(array($em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace); 58 62 59 63 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/\'(\d)/', '/(\s|\A|[([{<]|")\'/', '/(\d)"/', '/(\d)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/'); 60 64 $dynamic_replacements = array('’$1','’$1', '$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2');