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

Emojifying a country #1

Closed
zxcvbnmmohd opened this issue Apr 26, 2019 · 4 comments
Closed

Emojifying a country #1

zxcvbnmmohd opened this issue Apr 26, 2019 · 4 comments

Comments

@zxcvbnmmohd
Copy link

I followed your example and it works but when I use it to emojify a country it just shows the full text instead of the emoji.

ex:

EmojiParser().emojify('I :heart: :coffee:') // -> I ❤️ ☕
EmojiParser().emojify('I :flag-ca: :coffee:')  // -> I :flag-ca: ☕

and when I print the getEmoji/Name and hasEmoji/Name functions on it both the emoji and the name respectively I get the following:

I/flutter ( 7213): Emoji{name="flag-ca", full=":flag-ca:", code="🇨🇦"}
I/flutter ( 7213): Emoji{name="flag-ca", full=":flag-ca:", code="🇨🇦"}
true
true

When I use the emoji directly it works. What am I doing wrong?

@zxcvbnmmohd
Copy link
Author

Other regular emojis work though. Just the flags aren’t working.

@petehouston
Copy link
Owner

Strange though. Let me check.

@na2axl
Copy link

na2axl commented Nov 10, 2019

Hi @petehouston, the problem it's in your REGEX_NAME constant, it cannot detect names like :flag-ca: due to the dash, it's not a \w (word character) in regex.

I think changing the regex to :([\w-]+): may do the trick (I've not tested 😋)

@petehouston
Copy link
Owner

It is fixed in 2.2.0. Thank you.

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

3 participants