1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Allow diplayed reaction values to contain anything

Part of https://github.com/vector-im/riot-web/issues/10256
This commit is contained in:
J. Ryan Stinnett
2019-07-05 15:18:53 +01:00
parent 27c79b9504
commit 2a8f9a81f7
2 changed files with 1 additions and 14 deletions

View File

@@ -66,19 +66,10 @@ const VARIATION_SELECTOR = String.fromCharCode(0xFE0F);
* need emojification.
* unicodeToImage uses this function.
*/
export function mightContainEmoji(str) {
function mightContainEmoji(str) {
return SURROGATE_PAIR_PATTERN.test(str) || SYMBOL_PATTERN.test(str);
}
/**
* Returns true if the string definitely contains a single emoji.
* @param {String} str String to test
* @return {Boolean}
*/
export function isSingleEmoji(str) {
return mightContainEmoji(str) && SINGLE_EMOJI_REGEX.test(str);
}
/**
* Returns the shortcode for an emoji character.
*