Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
minor: Convert `emoticon_regex` to uppercase.
akshatdaltonffc4724287d0
diff --git a/zerver/lib/emoji.py b/zerver/lib/emoji.pyindex f6849313260..63b4a282d50 100644--- a/zerver/lib/emoji.py+++ b/zerver/lib/emoji.py@@ -30,7 +30,7 @@ EMOTICON_CONVERSIONS = emoji_codes["emoticon_conversions"]possible_emoticons = EMOTICON_CONVERSIONS.keys()possible_emoticon_regexes = (re.escape(emoticon) for emoticon in possible_emoticons)terminal_symbols = ",.;?!()\\[\\] \"'\\n\\t" # from composebox_typeahead.js-emoticon_regex = (+EMOTICON_RE = (f"(?<![^{terminal_symbols}])(?P<emoticon>("+ ")|(".join(possible_emoticon_regexes)+ f"))(?![^{terminal_symbols}])"diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.pyindex e6081b1e074..8cd62b4aa74 100644--- a/zerver/lib/markdown/__init__.py+++ b/zerver/lib/markdown/__init__.py@@ -48,12 +48,7 @@ from typing_extensions import TypedDictfrom zerver.lib import mention as mentionfrom zerver.lib.cache import NotFoundInCache, cache_with_keyfrom zerver.lib.camo import get_camo_url-from zerver.lib.emoji import (- codepoint_to_name,- emoticon_regex,- name_to_codepoint,- translate_emoticons,-)+from zerver.lib.emoji import EMOTICON_RE, codepoint_to_name, name_to_codepoint, translate_emoticonsfrom zerver.lib.exceptions import MarkdownRenderingExceptionfrom zerver.lib.markdown import fenced_codefrom zerver.lib.markdown.fenced_code import FENCE_RE@@ -2247,7 +2242,7 @@ class Markdown(markdown.Markdown):markdown.inlinepatterns.SimpleTextInlineProcessor(NOT_STRONG_RE), "not_strong", 20)reg.register(Emoji(EMOJI_REGEX, self), "emoji", 15)- reg.register(EmoticonTranslation(emoticon_regex, self), "translate_emoticons", 10)+ reg.register(EmoticonTranslation(EMOTICON_RE, self), "translate_emoticons", 10)# We get priority 5 from 'nl2br' extensionreg.register(UnicodeEmoji(unicode_emoji_regex), "unicodeemoji", 0)return reg