Skip to content

Commit

Permalink
Fix missing non_qualified fields for gendered emoji
Browse files Browse the repository at this point in the history
Some fully-qualified emoji have multiple unqualified forms in
emoji-test.txt:

    1F3F3 FE0F 200D 26A7 FE0F                              ; fully-qualified     # 🏳️‍⚧️ E13.0 transgender flag
    1F3F3 200D 26A7 FE0F                                   ; unqualified         # 🏳‍⚧️ E13.0 transgender flag
    1F3F3 FE0F 200D 26A7                                   ; unqualified         # 🏳️‍⚧ E13.0 transgender flag
    1F3F3 200D 26A7                                        ; unqualified         # 🏳‍⚧ E13.0 transgender flag

We need to build `$qualified_map` based on the first (fully-qualified)
row for each emoji, not the last one that has an FE0F.

Fixes #233.

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored and iamcal committed Feb 6, 2024
1 parent 12d82be commit a340ca1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 48 deletions.
4 changes: 3 additions & 1 deletion build/build_map.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
$p++;

$cp_nq = str_replace('-fe0f', '', $cp);
if ($cp != $cp_nq) $qualified_map[$cp_nq] = $cp;
if ($cp != $cp_nq && !isset($qualified_map[$cp_nq])){
$qualified_map[$cp_nq] = $cp;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion emoji.json

Large diffs are not rendered by default.

Loading

0 comments on commit a340ca1

Please sign in to comment.