mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +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:
parent
f31cc7dfee
commit
bd336b0710
1 changed files with 1 additions and 9 deletions
10
src/emoji.js
10
src/emoji.js
|
@ -87,13 +87,5 @@ EMOJIBASE.forEach(emoji => {
|
|||
* @returns {string} stripped string
|
||||
*/
|
||||
function stripVariation(str) {
|
||||
let ret = '';
|
||||
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;
|
||||
return str.replace("\uFE00-\uFE0F", "");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue