Ticket #64318: 64318-exclude-math-arrows.diff
| File 64318-exclude-math-arrows.diff, 1.2 KB (added by , 3 months ago) |
|---|
-
wp-includes/formatting.php
5120 5120 return $char; 5121 5121 } 5122 5122 5123 /* 5124 * Prevent math/logic arrow symbols from being replaced by Twemoji. 5125 * These symbols (e.g., ↦ ↤ ↥ ↧) belong to the Math Operators block 5126 * and should not be interpreted as emoji because it changes meaning. 5127 */ 5128 $blocked_math_arrows = array( '↦', '↤', '↥', '↧' ); 5129 5130 if ( in_array( $char, $blocked_math_arrows, true ) ) { 5131 return $char; 5132 } 5133 5123 5134 // Default emoji replacement. 5124 5135 return sprintf( 5125 5136 '<img src="%s" class="emoji" alt="%s" />', -
wp-includes/js/wp-emoji.js
240 240 // Emoji regex matches too many symbols including math arrows. 241 241 // Add an explicit exclusion range for U+21A6–U+21AA. 242 242 243 var emojiRegex = /\p{Extended_Pictographic} /u;243 var emojiRegex = /\p{Extended_Pictographic}(?![\u21A6-\u21AA])/u; 244 244 245 245 window.wpEmojiRegex = emojiRegex; 246 246 })();