emoji: Remap ':smile' emoji and update the settings UI.

This commit remaps the ':smile' emoji to 😄 and
introduces ':slight_smile' which maps to `🙂`.

Fixes #32712
This commit is contained in:
Ritwik
2025-03-25 23:44:57 +05:30
committed by Tim Abbott
parent 6c9de198b5
commit 9feba0f16f
16 changed files with 59 additions and 67 deletions

View File

@@ -6,7 +6,7 @@ CUSTOM_EMOJI_NAME_MAPS: dict[str, dict[str, Any]] = {
"1f603": {"canonical_name": "smiley", "aliases": []},
# the Google emoji for this is not great, so made People/9 'smile' and
# renamed this one
"1f604": {"canonical_name": "big_smile", "aliases": []},
"1f604": {"canonical_name": "smile", "aliases": []},
# from gemoji/Unicode
"1f601": {"canonical_name": "grinning_face_with_smiling_eyes", "aliases": []},
# satisfied doesn't seem like a good description of these images
@@ -20,7 +20,7 @@ CUSTOM_EMOJI_NAME_MAPS: dict[str, dict[str, Any]] = {
"1f60a": {"canonical_name": "blush", "aliases": []},
# halo comes from gemoji/Unicode
"1f607": {"canonical_name": "innocent", "aliases": ["halo"]},
"1f642": {"canonical_name": "smile", "aliases": []},
"1f642": {"canonical_name": "slight_smile", "aliases": []},
"1f643": {"canonical_name": "upside_down", "aliases": ["oops"]},
"1f609": {"canonical_name": "wink", "aliases": []},
"1f60c": {"canonical_name": "relieved", "aliases": []},

View File

@@ -1194,7 +1194,7 @@ EMOJI_NAME_MAPS: dict[str, dict[str, Any]] = {
"1f601": {"canonical_name": "grinning_face_with_smiling_eyes", "aliases": []},
"1f602": {"canonical_name": "joy", "aliases": ["tears", "laughter_tears"]},
"1f603": {"canonical_name": "smiley", "aliases": []},
"1f604": {"canonical_name": "big_smile", "aliases": []},
"1f604": {"canonical_name": "smile", "aliases": []},
"1f605": {"canonical_name": "sweat_smile", "aliases": []},
"1f606": {"canonical_name": "laughing", "aliases": ["lol"]},
"1f607": {"canonical_name": "innocent", "aliases": ["halo"]},
@@ -1284,7 +1284,7 @@ EMOJI_NAME_MAPS: dict[str, dict[str, Any]] = {
"canonical_name": "head_shaking_vertically",
"aliases": ["nod", "vertically"],
},
"1f642": {"canonical_name": "smile", "aliases": []},
"1f642": {"canonical_name": "slight_smile", "aliases": []},
"1f643": {"canonical_name": "upside_down", "aliases": ["oops"]},
"1f644": {"canonical_name": "rolling_eyes", "aliases": []},
"1f645-200d-2640": {"canonical_name": "woman_gesturing_no", "aliases": []},

View File

@@ -35,14 +35,14 @@ REMAPPED_EMOJIS = {
# Emoticons and which emoji they should become. Duplicate emoji are allowed.
# Changes here should be mimicked in `help/configure-emoticon-translations.md`.
EMOTICON_CONVERSIONS = {
":)": ":smile:",
"(:": ":smile:",
":)": ":slight_smile:",
"(:": ":slight_smile:",
":(": ":frown:",
"<3": ":heart:",
":|": ":neutral:",
":/": ":confused:",
";)": ":wink:",
":D": ":grinning:",
":D": ":smile:",
":o": ":open_mouth:",
":O": ":open_mouth:",
":p": ":stuck_out_tongue:",

View File

@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 377 # Last bumped to sending peer_remove on user deactivati
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = (322, 0) # bumped 2025-03-26 for updated build_timezone_values.
PROVISION_VERSION = (323, 0) # bumped 2025-04-07 for smile emoji changes.

View File

@@ -22,7 +22,7 @@ import _ from "lodash";
export const popular_emojis = [
"1f44d", // +1
"1f389", // tada
"1f642", // smile
"1f642", // slight_smile
"2764", // heart
"1f6e0", // working_on_it
"1f419", // octopus

View File

@@ -558,7 +558,7 @@ export const preferences_settings_labels = {
twenty_four_hour_time: $t({defaultMessage: "Time format"}),
translate_emoticons: new Handlebars.SafeString(
$t_html({
defaultMessage: "Convert emoticons before sending (<code>:)</code> becomes 😃)",
defaultMessage: "Convert emoticons before sending (<code>:)</code> becomes 🙂)",
}),
),
web_suggest_update_timezone: $t({

View File

@@ -21,7 +21,7 @@
{{#if (eq this.key "text") }}
<div class="emoji_alt_code">&nbsp;:relaxed:</div>
{{else}}
<img class="emoji" src="/static/generated/emoji/images-{{this.key}}-64/1f642.png" />
<img class="emoji" src="/static/generated/emoji/images-{{this.key}}-64/1f604.png" />
<img class="emoji" src="/static/generated/emoji/images-{{this.key}}-64/1f44d.png" />
<img class="emoji" src="/static/generated/emoji/images-{{this.key}}-64/1f680.png" />
<img class="emoji" src="/static/generated/emoji/images-{{this.key}}-64/1f389.png" />

View File

@@ -210,7 +210,7 @@ run_test("paste_handler_converter", () => {
// Emojis
input =
'<meta http-equiv="content-type" content="text/html; charset=utf-8"><span style="color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">emojis:<span> </span></span><span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile" style="height: 20px; width: 20px; position: relative; margin-top: -7px; vertical-align: middle; top: 3px; background-position: 55% 46.667%; display: inline-block; background-image: url(&quot;http://localhost:9991/webpack/files/generated/emoji/google.webp&quot;); background-size: 6100%; background-repeat: no-repeat; text-indent: 100%; white-space: nowrap; overflow: hidden; color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:smile:</span><span style="color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span> </span></span><span aria-label="family man woman girl" class="emoji emoji-1f468-200d-1f469-200d-1f467" role="img" title="family man woman girl" style="height: 20px; width: 20px; position: relative; margin-top: -7px; vertical-align: middle; top: 3px; background-position: 23.333% 75%; display: inline-block; background-image: url(&quot;http://localhost:9991/webpack/files/generated/emoji/google.webp&quot;); background-size: 6100%; background-repeat: no-repeat; text-indent: 100%; white-space: nowrap; overflow: hidden; color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:family_man_woman_girl:</span>';
'<meta http-equiv="content-type" content="text/html; charset=utf-8"><span style="color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">emojis:<span> </span></span><span aria-label="smile" class="emoji emoji-1f604" role="img" title="smile" style="height: 20px; width: 20px; position: relative; margin-top: -7px; vertical-align: middle; top: 3px; background-position: 55% 46.667%; display: inline-block; background-image: url(&quot;http://localhost:9991/webpack/files/generated/emoji/google.webp&quot;); background-size: 6100%; background-repeat: no-repeat; text-indent: 100%; white-space: nowrap; overflow: hidden; color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:smile:</span><span style="color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span> </span></span><span aria-label="family man woman girl" class="emoji emoji-1f468-200d-1f469-200d-1f467" role="img" title="family man woman girl" style="height: 20px; width: 20px; position: relative; margin-top: -7px; vertical-align: middle; top: 3px; background-position: 23.333% 75%; display: inline-block; background-image: url(&quot;http://localhost:9991/webpack/files/generated/emoji/google.webp&quot;); background-size: 6100%; background-repeat: no-repeat; text-indent: 100%; white-space: nowrap; overflow: hidden; color: rgb(221, 222, 238); font-family: &quot;Source Sans 3&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(33, 45, 59); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:family_man_woman_girl:</span>';
assert.equal(
compose_paste.paste_handler_converter(input),
"emojis: :smile: :family_man_woman_girl:",

View File

@@ -60,7 +60,7 @@ run_test("get_emoji_details_by_name", () => {
let result = emoji.get_emoji_details_by_name(emoji_name);
assert.deepEqual(result, {
emoji_name: "smile",
emoji_code: "1f642",
emoji_code: "1f604",
reaction_type: "unicode_emoji",
});
@@ -71,7 +71,7 @@ run_test("get_emoji_details_by_name", () => {
assert.deepEqual(result, {
emoji_name: "smile",
reaction_type: "unicode_emoji",
emoji_code: "1f642",
emoji_code: "1f604",
});
// Test adding zulip emoji.

View File

@@ -598,7 +598,7 @@ test("marked", ({override}) => {
{
input: ":)",
expected:
'<p><span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>',
'<p><span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>',
translate_emoticons: true,
},
// Test HTML escaping in custom Zulip rules
@@ -990,7 +990,7 @@ test("translate_emoticons_to_names", () => {
// Simple test
const test_text = "Testing :)";
const expected = "Testing :smile:";
const expected = "Testing :slight_smile:";
const result = translate_emoticons_to_names(test_text);
assert.equal(result, expected);

View File

@@ -89,7 +89,7 @@ function get_emoticon_translations() {
}
const emoji_map = new Map();
emoji_map.set("smile", "1f642");
emoji_map.set("smile", "1f604");
emoji_map.set("alien", "1f47d");
function get_emoji_codepoint(emoji_name) {
@@ -203,7 +203,7 @@ run_test("stream links", () => {
run_test("emojis", () => {
assert_parse(
"yup :)",
'<p>yup <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>',
'<p>yup <span aria-label="smile" class="emoji emoji-1f604" role="img" title="smile">:smile:</span></p>',
);
assert_parse(
"I <3 JavaScript",

View File

@@ -14,8 +14,8 @@ const alice_user_id = 5;
const sample_message = {
id: 1001,
reactions: [
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 6, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f604"},
{emoji_name: "smile", user_id: 6, reaction_type: "unicode_emoji", emoji_code: "1f604"},
{emoji_name: "frown", user_id: 7, reaction_type: "unicode_emoji", emoji_code: "1f641"},
{emoji_name: "tada", user_id: 7, reaction_type: "unicode_emoji", emoji_code: "1f389"},
@@ -136,7 +136,7 @@ test("basics", () => {
settings_data.user_can_access_all_other_users = () => true;
const message = sample_message_with_clean_reactions();
const result = reactions.get_message_reactions(message);
assert.ok(reactions.current_user_has_reacted_to_emoji(message, "unicode_emoji,1f642"));
assert.ok(reactions.current_user_has_reacted_to_emoji(message, "unicode_emoji,1f604"));
assert.ok(!reactions.current_user_has_reacted_to_emoji(message, "bogus"));
result.sort((a, b) => a.count - b.count);
@@ -173,8 +173,8 @@ test("basics", () => {
{
emoji_name: "smile",
reaction_type: "unicode_emoji",
emoji_code: "1f642",
local_id: "unicode_emoji,1f642",
emoji_code: "1f604",
local_id: "unicode_emoji,1f604",
count: 2,
vote_text: "2",
user_ids: [5, 6],
@@ -232,8 +232,8 @@ test("reactions from unknown users", () => {
const message = {
id: 1001,
reactions: [
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 9, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f604"},
{emoji_name: "smile", user_id: 9, reaction_type: "unicode_emoji", emoji_code: "1f604"},
{emoji_name: "frown", user_id: 9, reaction_type: "unicode_emoji", emoji_code: "1f641"},
{emoji_name: "tada", user_id: 6, reaction_type: "unicode_emoji", emoji_code: "1f389"},
@@ -262,8 +262,8 @@ test("reactions from unknown users", () => {
{
emoji_name: "smile",
reaction_type: "unicode_emoji",
emoji_code: "1f642",
local_id: "unicode_emoji,1f642",
emoji_code: "1f604",
local_id: "unicode_emoji,1f604",
count: 2,
vote_text: "2",
user_ids: [5, 9],
@@ -350,7 +350,7 @@ test("sending", ({override, override_rewire}) => {
assert.deepEqual(args.data, {
reaction_type: "unicode_emoji",
emoji_name: "smile",
emoji_code: "1f642",
emoji_code: "1f604",
});
// args.success() does nothing; just make sure it doesn't crash
args.success();
@@ -573,7 +573,7 @@ test("get_reaction_sections", () => {
test("emoji_reaction_title", ({override}) => {
const message = sample_message_with_clean_reactions();
override(message_store, "get", () => message);
const local_id = "unicode_emoji,1f642";
const local_id = "unicode_emoji,1f604";
assert.equal(
reactions.get_reaction_title_data(message.id, local_id),
@@ -1402,21 +1402,21 @@ test("process_reaction_click", ({override, override_rewire}) => {
const expected_reaction_info = {
reaction_type: "unicode_emoji",
emoji_name: "smile",
emoji_code: "1f642",
emoji_code: "1f604",
};
// Test spectator cannot react.
page_params.is_spectator = true;
let stub = make_stub();
spectators.login_to_access = stub.f;
reactions.process_reaction_click(message.id, "unicode_emoji,1f642");
reactions.process_reaction_click(message.id, "unicode_emoji,1f604");
let args = stub.get_args("args").args;
assert.equal(args, undefined);
page_params.is_spectator = false;
stub = make_stub();
channel.del = stub.f;
reactions.process_reaction_click(message.id, "unicode_emoji,1f642");
reactions.process_reaction_click(message.id, "unicode_emoji,1f604");
assert.equal(stub.num_calls, 1);
args = stub.get_args("args").args;
assert.equal(args.url, "/json/messages/1001/reactions");
@@ -1449,8 +1449,8 @@ test("duplicates", () => {
const dup_reaction_message = {
id: 1001,
reactions: [
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f642"},
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f604"},
{emoji_name: "smile", user_id: 5, reaction_type: "unicode_emoji", emoji_code: "1f604"},
],
};

View File

@@ -9,8 +9,8 @@ const typeahead = zrequire("../shared/src/typeahead");
const unicode_emojis = [
["1f43c", "panda_face"],
["1f642", "smile"],
["1f604", "big_smile"],
["1f642", "slight_smile"],
["1f604", "smile"],
["1f368", "ice_cream"],
["1f366", "soft_ice_cream"],
["1f6a5", "horizontal_traffic_light"],
@@ -46,8 +46,8 @@ run_test("get_emoji_matcher: nonmatches", () => {
run_test("get_emoji_matcher: misc matches", () => {
assert_emoji_matches("da", ["panda_face", "tada"]);
assert_emoji_matches("smil", ["big_smile", "smile"]);
assert_emoji_matches("mile", ["big_smile", "smile"]);
assert_emoji_matches("smil", ["slight_smile", "smile"]);
assert_emoji_matches("mile", ["slight_smile", "smile"]);
assert_emoji_matches("japanese_post_", ["japanese_post_office"]);
});
@@ -191,28 +191,20 @@ run_test("sort_emojis: th", () => {
run_test("sort_emojis: sm", () => {
const emoji_list = [
{emoji_name: "big_smile", is_realm_emoji: true},
{emoji_name: "smile", is_realm_emoji: true},
{emoji_name: "slight_smile", is_realm_emoji: false, emoji_code: "1f642"},
{emoji_name: "small_airplane", is_realm_emoji: true},
];
assert.deepEqual(sort_emojis(emoji_list, "sm"), [
"slight_smile",
"small_airplane",
"big_smile",
]);
assert.deepEqual(sort_emojis(emoji_list, "sm"), ["slight_smile", "smile", "small_airplane"]);
});
run_test("sort_emojis: SM", () => {
const emoji_list = [
{emoji_name: "big_smile", is_realm_emoji: true},
{emoji_name: "smile", is_realm_emoji: true},
{emoji_name: "slight_smile", is_realm_emoji: false, emoji_code: "1f642"},
{emoji_name: "small_airplane", is_realm_emoji: true},
];
assert.deepEqual(sort_emojis(emoji_list, "SM"), [
"slight_smile",
"small_airplane",
"big_smile",
]);
assert.deepEqual(sort_emojis(emoji_list, "SM"), ["slight_smile", "smile", "small_airplane"]);
});
run_test("sort_emojis: prefix before midphrase, with underscore (traffic_li)", () => {

View File

@@ -273,7 +273,7 @@
"chart_increasing": "1f4c8",
"white_medium_square": "25fb",
"sunflower": "1f33b",
"simple_smile": "1f642",
"simple_smile": "1f604",
"worried_face": "1f61f",
"weary_face": "1f629",
"innocent": "1f607",
@@ -470,7 +470,7 @@
"water_wave": "1f30a",
"o_button": "1f17e",
"racing_car": "1f3ce",
"slightly_smiling_face": "1f642",
"slightly_smiling_face": "1f604",
"face_massage": "1f486",
"blue_book": "1f4d8",
"reminder_ribbon": "1f397",

View File

@@ -361,8 +361,8 @@
{
"name": "star_emoji",
"input": "**:smile:**",
"expected_output": "<p><strong><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></strong></p>",
"text_content": "\ud83d\ude42"
"expected_output": "<p><strong><span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span></strong></p>",
"text_content": "\ud83d\ude04"
},
{
"name": "star_strong_em",
@@ -525,8 +525,8 @@
{
"name": "many_emoji",
"input": "test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:",
"expected_output": "<p>test <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> again <span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>",
"text_content": "test \ud83d\ude42 again \ud83d\udca9\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:"
"expected_output": "<p>test <span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span> again <span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>",
"text_content": "test \ud83d\ude04 again \ud83d\udca9\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:"
},
{
"name": "translate_emoticons_not_enabled",
@@ -538,15 +538,15 @@
{
"name": "translate_emoticons_enabled",
"input": ":)",
"expected_output": "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>",
"expected_output": "<p><span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span></p>",
"text_content": "\ud83d\ude42",
"translate_emoticons": true
},
{
"name": "translate_emoticons",
"input": ":) foo :( bar <3 with space : ) real emoji :smile:",
"expected_output": "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> foo <span aria-label=\"frown\" class=\"emoji emoji-1f641\" role=\"img\" title=\"frown\">:frown:</span> bar <span aria-label=\"heart\" class=\"emoji emoji-2764\" role=\"img\" title=\"heart\">:heart:</span> with space : ) real emoji <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>",
"text_content": "\ud83d\ude42 foo \ud83d\ude41 bar \u2764 with space : ) real emoji \ud83d\ude42",
"expected_output": "<p><span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span> foo <span aria-label=\"frown\" class=\"emoji emoji-1f641\" role=\"img\" title=\"frown\">:frown:</span> bar <span aria-label=\"heart\" class=\"emoji emoji-2764\" role=\"img\" title=\"heart\">:heart:</span> with space : ) real emoji <span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span></p>",
"text_content": "\ud83d\ude42 foo \ud83d\ude41 bar \u2764 with space : ) real emoji \ud83d\ude04",
"translate_emoticons": true
},
{
@@ -559,7 +559,7 @@
{
"name": "translate_emoticons_newline",
"input": ":) test\n:) test",
"expected_output": "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> test<br>\n<span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> test</p>",
"expected_output": "<p><span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span> test<br>\n<span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span> test</p>",
"text_content": "\ud83d\ude42 test\n\ud83d\ude42 test",
"translate_emoticons": true
},
@@ -573,14 +573,14 @@
{
"name": "translate_emoticons_at_sentence_end",
"input": "Translate this :).",
"expected_output": "<p>Translate this <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>.</p>",
"expected_output": "<p>Translate this <span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span>.</p>",
"text_content": "Translate this \ud83d\ude42.",
"translate_emoticons": true
},
{
"name": "translate_emoticons_between_symbols",
"input": "Translate this !:)?",
"expected_output": "<p>Translate this !<span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>?</p>",
"expected_output": "<p>Translate this !<span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span>?</p>",
"marked_expected_output": "<p>Translate this !:)?</p>",
"text_content": "Translate this !\ud83d\ude42?",
"translate_emoticons": true
@@ -707,7 +707,7 @@
{
"name": "emoji_alongside_punctuation",
"input": ":smile:, :smile:; :smile:",
"expected_output": "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>, <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>; <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>"
"expected_output": "<p><span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span>, <span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span>; <span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span></p>"
},
{
"name": "new_emoji_test",
@@ -748,7 +748,7 @@
{
"name": "valid_emoji_preceded_by_invalid_emoji",
"input": "This is :invalidemoji: which should not prevent rendering :smile:",
"expected_output": "<p>This is :invalidemoji: which should not prevent rendering <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>"
"expected_output": "<p>This is :invalidemoji: which should not prevent rendering <span aria-label=\"smile\" class=\"emoji emoji-1f604\" role=\"img\" title=\"smile\">:smile:</span></p>"
},
{
"name": "safe_html",
@@ -993,8 +993,8 @@
},
{
"name": "spoilers_with_header_markdown",
"input": "```spoiler [Header](https://example.com) :smile:\ncontent\n```",
"expected_output": "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p><a href=\"https://example.com\">Header</a> <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>",
"input": "```spoiler [Header](https://example.com) :slight_smile:\ncontent\n```",
"expected_output": "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p><a href=\"https://example.com\">Header</a> <span aria-label=\"slight smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"slight smile\">:slight_smile:</span></p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>",
"text_content": "Header 🙂 (…)\n"
},
{

View File

@@ -95,7 +95,7 @@ class ReactionEmojiTest(ZulipTestCase):
Formatted reactions data is saved in cache.
"""
senders = [self.example_user("hamlet"), self.example_user("cordelia")]
emojis = ["smile", "tada"]
emojis = ["slight_smile", "tada"]
expected_emoji_codes = ["1f642", "1f389"]
for sender, emoji in zip(senders, emojis, strict=False):