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

Smile.unmodify handles ZWJ sequences in potentially unexpected ways #26

Open
Sweeper777 opened this issue Oct 7, 2021 · 2 comments
Open

Comments

@Sweeper777
Copy link

Consider πŸ‘©πŸ»β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸΌ, which is formed of

  • πŸ‘© (woman)
  • Light Skin Tone
  • ZERO WIDTH JOINER
  • HEAVY BLACK HEART
  • VARIATION SELECTOR-16
  • ZERO WIDTH JOINER
  • πŸ’‹ (kiss mark)
  • ZERO WIDTH JOINER
  • πŸ‘¨ (man)
  • Medium-light Skin Tone

If I do

Smile.unmodify(emoji: "πŸ‘©πŸ»β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸΌ")

Everything except the πŸ‘© is removed. This completely changes the meaning of the emoji, which I don't think unmodify is supposed to do. I had expected πŸ‘©β€β€οΈβ€πŸ’‹β€πŸ‘¨ instead. Is this intentional?

@onmyway133
Copy link
Owner

Hi, it is expected to keep just the "prominent" info. Maybe you can try disassemble method ?

@Sweeper777
Copy link
Author

Ah, so you have another method for this purpose :) disassemble does remove the modifiers, which is what I want. However, it also removes the heart :(

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