Merge pull request #8327 from tulir/emoji-variation-selectors
Add variation selector 16 to all applicable emojis
This commit is contained in:
commit
09e1d4d97a
|
@ -0,0 +1 @@
|
|||
Fix duplicate reactions when using full emoji picker. Contributed by @tulir @ Beeper.
|
File diff suppressed because it is too large
Load Diff
|
@ -26,6 +26,13 @@ print("Fetching emoji list from Unicode.org...")
|
|||
req = requests.get("https://unicode.org/emoji/charts/emoji-list.html")
|
||||
soup = BeautifulSoup(req.content, 'html.parser')
|
||||
|
||||
variation_sequence_data = requests.get("https://www.unicode.org/Public/15.0.0/ucd/emoji/emoji-variation-sequences.txt").text
|
||||
variation_sequence_overrides = {}
|
||||
for line in variation_sequence_data.split("\n"):
|
||||
if "emoji style" in line:
|
||||
emoji_hex = line.split(" ", 1)[0]
|
||||
variation_sequence_overrides[emoji_hex] = emoji_hex + "-FE0F"
|
||||
|
||||
# Navigate to table
|
||||
table = soup.body.table
|
||||
|
||||
|
@ -121,6 +128,8 @@ for emoji in emoji_picker_datasource_emojis:
|
|||
new_keywords.pop(keyword)
|
||||
# Write new keywords back
|
||||
emoji_picker_datasource_emojis[emoji]["j"] = list(new_keywords.keys())
|
||||
if emoji_code in variation_sequence_overrides:
|
||||
emoji_picker_datasource_emojis[emoji]["b"] = variation_sequence_overrides[emoji_code]
|
||||
|
||||
# Filter out components from unicode 13.1 (as they are not suitable for single-emoji reactions)
|
||||
emoji_picker_datasource['categories'] = [x for x in emoji_picker_datasource['categories'] if x['id'] != 'component']
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue