From 48805e8d0f93bb45c5d75042b76fedb66f9086ad Mon Sep 17 00:00:00 2001 From: Shahrum Amiri <16479237+ShahrumAmiri@users.noreply.github.com> Date: Wed, 7 Oct 2026 18:06:24 -0400 Subject: [PATCH] fix(clean): one astral range per class in EMOJI CodeQL still flagged py/overly-large-range after the duplicate range was removed: it reads two astral ranges in one character class as overlapping. Same code points match as before (checked across all of Unicode). Co-Authored-By: Claude Opus 5.5 --- inboxink/clean.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inboxink/clean.py b/inboxink/clean.py index 861991d..6e539fb 100644 --- a/inboxink/clean.py +++ b/inboxink/clean.py @@ -64,8 +64,9 @@ def unwrap(url): # E-reader fonts have no emoji or pictographs: they render as tofu boxes, so they go. -EMOJI = re.compile("[\U0001F000-\U0001FAFF\U00002600-\U000027BF\U00002B00-\U00002BFF" - "\U0000FE00-\U0000FE0F\U0000200D\U000020E3\U000E0000-\U000E007F]") +# One astral range per character class: CodeQL misreads two astral ranges in one class as overlapping. +EMOJI = re.compile("[\U0001F000-\U0001FAFF]|[\U000E0000-\U000E007F]" + "|[\u2600-\u27BF\u2B00-\u2BFF\uFE00-\uFE0F\u200D\u20E3]") def no_emoji(text):