You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Use a regex because it's simpler and works
and my loop did not because I meant 'or', not 'and'
This commit is contained in:
10
src/emoji.js
10
src/emoji.js
@@ -87,13 +87,5 @@ EMOJIBASE.forEach(emoji => {
|
|||||||
* @returns {string} stripped string
|
* @returns {string} stripped string
|
||||||
*/
|
*/
|
||||||
function stripVariation(str) {
|
function stripVariation(str) {
|
||||||
let ret = '';
|
return str.replace("\uFE00-\uFE0F", "");
|
||||||
for (let i = 0; i < str.length; ++i) {
|
|
||||||
const charCode = str.charCodeAt(i);
|
|
||||||
// append to output only if it's outside the variation selector range
|
|
||||||
if (charCode < 0xFE00 && charCode > 0xFE0F) {
|
|
||||||
ret += str.charAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user