Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The number is not emoji #17

Open
light-of-king opened this issue Nov 26, 2017 · 3 comments
Open

The number is not emoji #17

light-of-king opened this issue Nov 26, 2017 · 3 comments

Comments

@light-of-king
Copy link

use stringify and parse
1 trans to 1️⃣

@romreed
Copy link

romreed commented Aug 22, 2018

i have the same bug. Have you found a solution?

@light-of-king
Copy link
Author

const stringify = (text) => {
let result = ''
const arr = _.toArray(text);
_.each(arr, (value, key) => {
// add this line
if (value.length==1) return result += value;
const index = _.findIndex(emojiData, function (o) {
const emoji = String.fromCodePoint(...o.unified.split('-').map(u => '0x' + u));
return emoji.codePointAt() == value.codePointAt();
});
if (index > -1) {
result += '[' + emojiData[index]['name'] + ']';
} else {
result += value;
}
});
return result;
};

@light-of-king
Copy link
Author

@romreed stringify.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants