Ticket #23185: FixHyphens.diff
File FixHyphens.diff, 1.4 KB (added by , 12 years ago) |
---|
-
wp-includes/formatting.php
70 70 $cockney = $cockneyreplace = array(); 71 71 } 72 72 73 $static_characters = array_merge( array( '---', ' -- ', '--', ' - ','xn–', '...', '``', '\'\'', ' (tm)' ), $cockney );74 $static_replacements = array_merge( array( $em_dash, ' ' . $em_dash . ' ', $en_dash, ' ' . $en_dash . ' ','xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace );73 $static_characters = array_merge( array('xn–', '...', '``', '\'\'', ' (tm)' ), $cockney ); 74 $static_replacements = array_merge( array('xn--', '…', $opening_quote, $closing_quote, ' ™' ), $cockneyreplace ); 75 75 76 76 $dynamic = array(); 77 77 if ( "'" != $apos ) { … … 95 95 96 96 $dynamic[ '/\b(\d+)x(\d+)\b/' ] = '$1×$2'; // 9x9 (times) 97 97 98 $dynamic[ '/---/' ] = $em_dash; // Triple-hyphen becomes em dash 99 100 // Hyphen or double-hyphen surrounded by space become en or em dash 101 $dynamic[ '/( | )-( | )/' ] = '$1' . $en_dash . '$2'; 102 $dynamic[ '/( | )--( | )/' ] = '$1' . $em_dash . '$2'; 103 104 $dynamic[ '/--/' ] = $en_dash; // Remaining double-hyphens become en-dash 105 98 106 $dynamic_characters = array_keys( $dynamic ); 99 107 $dynamic_replacements = array_values( $dynamic ); 100 108 }