-
Notifications
You must be signed in to change notification settings - Fork 36
[WIP] Fix dealing presentation selector #46 #48
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -791,8 +791,8 @@ | |||||||||||||||||
| ":man-woman-girl:": 1f468-200d-1f469-200d-1f467 | ||||||||||||||||||
| ":man-woman-girl-boy:": 1f468-200d-1f469-200d-1f467-200d-1f466 | ||||||||||||||||||
| ":man-woman-girl-girl:": 1f468-200d-1f469-200d-1f467-200d-1f467 | ||||||||||||||||||
| ":man-heart-man:": 1f468-200d-2764-fe0f-200d-1f468 | ||||||||||||||||||
| ":man-kiss-man:": 1f468-200d-2764-fe0f-200d-1f48b-200d-1f468 | ||||||||||||||||||
| ":man-heart-man:": 1f468-200d-2764-200d-1f468 | ||||||||||||||||||
| ":man-kiss-man:": 1f468-200d-2764-200d-1f48b-200d-1f468 | ||||||||||||||||||
|
Comment on lines
+794
to
+795
|
||||||||||||||||||
| ":man-heart-man:": 1f468-200d-2764-200d-1f468 | |
| ":man-kiss-man:": 1f468-200d-2764-200d-1f48b-200d-1f468 | |
| ":man-heart-man:": 1f468-200d-2764-fe0f-200d-1f468 | |
| ":man-kiss-man:": 1f468-200d-2764-fe0f-200d-1f48b-200d-1f468 |
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as above for the woman/man heart/kiss sequences: removing FE0F here will generate incorrect emoji URLs (missing -fe0f-) and will fail to match the actual unicode sequence during parsing. These codepoint values should remain aligned with the Twemoji asset filenames in the png/svg maps.
| ":woman-heart-man:": 1f469-200d-2764-200d-1f468 | |
| ":woman-heart-woman:": 1f469-200d-2764-200d-1f469 | |
| ":woman-kiss-man:": 1f469-200d-2764-200d-1f48b-200d-1f468 | |
| ":woman-kiss-woman:": 1f469-200d-2764-200d-1f48b-200d-1f469 | |
| ":woman-heart-man:": 1f469-200d-2764-fe0f-200d-1f468 | |
| ":woman-heart-woman:": 1f469-200d-2764-fe0f-200d-1f469 | |
| ":woman-kiss-man:": 1f469-200d-2764-fe0f-200d-1f48b-200d-1f468 | |
| ":woman-kiss-woman:": 1f469-200d-2764-fe0f-200d-1f48b-200d-1f469 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -83,6 +83,14 @@ def test_find_by_escaped_unicode | |||||||||||||||||||
| assert_equal ":heart_eyes:", Twemoji.find_by_unicode("\u{1f60d}") | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| def test_find_by_code_including_emoji_presentation_selector | ||||||||||||||||||||
| assert_equal ":eye::left_speech_bubble:", Twemoji.find_by_code("1f441-fe0f-200d-1f5e8-fe0f") | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
| def test_find_by_unicode_including_emoji_presentation_selector | ||||||||||||||||||||
| assert_equal ":eye::left_speech_bubble:", Twemoji.find_by_unicode("\u{1f441}\u{fe0f}\u{200d}\u{1f5e8}\u{fe0f}") | ||||||||||||||||||||
| end | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
||||||||||||||||||||
| def test_find_by_code_including_text_presentation_selector | |
| assert_equal ":eye::left_speech_bubble:", Twemoji.find_by_code("1f441-fe0e-200d-1f5e8-fe0e") | |
| end | |
| def test_find_by_unicode_including_text_presentation_selector | |
| assert_equal ":eye::left_speech_bubble:", Twemoji.find_by_unicode("\u{1f441}\u{fe0e}\u{200d}\u{1f5e8}\u{fe0e}") | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These finder methods now normalize away FE0E/FE0F, but
Twemoji.parsestill depends on regex matching of raw unicode sequences (emoji_pattern_all) and onunicode_to_strfor URL generation. If the intent is to ignore presentation selectors during parsing as well, the normalization needs to be applied in the parse/matching path; otherwise unicode input containing FE0E/FE0F may not be replaced consistently.