mirror of https://github.com/vector-im/riot-web
Use a regex because it's simpler and works
and my loop did not because I meant 'or', not 'and'pull/21833/head
parent
f31cc7dfee
commit
bd336b0710
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;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue