Merge pull request #4930 from jjaffeux/explicit-emoji-code

Explains sort/reverse of emoji replacements
This commit is contained in:
Régis Hanol 2017-06-14 17:57:26 +02:00 committed by GitHub
commit 27ca05d94c
1 changed files with 1 additions and 0 deletions

View File

@ -7,6 +7,7 @@ let _unicodeRegexp;
export function setUnicodeReplacements(replacements) {
_unicodeReplacements = replacements;
if (replacements) {
// We sort and reverse to match longer emoji sequences first
_unicodeRegexp = new RegExp(Object.keys(replacements).sort().reverse().join("|"), "g");
}
};