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

Better support for emoji with zero width connectors #17

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

tmdvs
Copy link
Owner

@tmdvs tmdvs commented Oct 19, 2024

The zero-width connector is a special character used to combine multiple emoji into a single emoji character on screen. For example πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§

This patches the code to skip specific instances of the zero-width connector to avoid parsing parts of the emoji as unicode characters/breaking into multiple emoji.

This is based on #12 (comment)

@tmdvs tmdvs changed the title Better support for emojis with zero width connectors Better support for emoji with zero width connectors Oct 19, 2024
@@ -9,7 +9,7 @@ import (

// SearchResult - Occurrence of an emoji in a string
type SearchResult struct {
Match interface{}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have never been an interface, it leads to unnecessary type conversion/checking.

@tmdvs tmdvs merged commit 971af81 into main Oct 19, 2024
1 check passed
@tmdvs tmdvs deleted the fix/ignore-unicode-if-emoji-connector branch October 19, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant