From d12f3eda61c8385b89d0fca719eb87a5a756edf0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 26 May 2022 06:39:32 -0400 Subject: [PATCH] Fix detection of some emoji set as colored tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emoji such as ⭐️ that began as text-based Unicode characters and depend on Variation Selector-16 to display the emoji presentation weren't being properly detected. --- chrome/content/zotero/itemTree.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/itemTree.jsx b/chrome/content/zotero/itemTree.jsx index 67ee178162..47b1b00b94 100644 --- a/chrome/content/zotero/itemTree.jsx +++ b/chrome/content/zotero/itemTree.jsx @@ -40,7 +40,7 @@ Cu.import("resource://gre/modules/osfile.jsm"); const CHILD_INDENT = 12; const COLORED_TAGS_RE = new RegExp("^[0-" + Zotero.Tags.MAX_COLORED_TAGS + "]{1}$"); const COLUMN_PREFS_FILEPATH = OS.Path.join(Zotero.Profile.dir, "treePrefs.json"); -const EMOJI_RE = /\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu; +const EMOJI_RE = /\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}|[\u200D\uFE0F]/gu; const HTML_NS = "http://www.w3.org/1999/xhtml"; const ATTACHMENT_STATE_LOAD_DELAY = 150; //ms @@ -3826,8 +3826,8 @@ var ItemTree = class ItemTree extends LibraryTree { } _isOnlyEmoji(str) { - // Remove emoji and zero-width joiner and see if anything's left - return !str.replace(EMOJI_RE, '').replace(/\u200D/g,''); + // Remove emoji, Zero Width Joiner, and Variation Selector-16 and see if anything's left + return !str.replace(EMOJI_RE, ''); } _getTagSwatch(tag, color) {