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

This emoji is not deleted #6

Open
jesusvallez opened this issue May 6, 2017 · 5 comments
Open

This emoji is not deleted #6

jesusvallez opened this issue May 6, 2017 · 5 comments

Comments

@jesusvallez
Copy link

Hello everyone!

I am using your library but I have an issue:
test\u26A1**\uFE0F** (test⚡️)

This emoji is not deleted.
When I stip the string I get this: test**\uFE0F**

Could you help me?

@jrejaud
Copy link

jrejaud commented Feb 14, 2018

Those codes are present in the regex string from the emoji-regex dependency (https://github.com/mathiasbynens/emoji-regex/blob/master/index.js), so I'm not sure why they aren't getting stripped out.

A remove all non-ascii characters regex works as a workaround for me:

return myString.replace(/[^\x00-\x7F]/g, "");

@nizaroni
Copy link
Owner

It might be a question of updating the dependencies to get the latest version of emoji-regex. I'll take a closer look this weekend.

@jrejaud
Copy link

jrejaud commented Feb 14, 2018 via email

@zkhalapyan
Copy link

Ditto, 🥳, is not removed either.

@zkhalapyan
Copy link

I am not proud of this, but it works...

var emojiStrip = require('emoji-strip')
function strimEmojis(string) {
    return emojiStrip(string).replace(/([\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g, '');
 }

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

4 participants