Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

minor: Convert `user_group_mentions` to uppercase.

akshatdalton9f6e6709d35d
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py
index d217cf5c96b..e6081b1e074 100644
--- a/zerver/lib/markdown/__init__.py
+++ b/zerver/lib/markdown/__init__.py
@@ -2231,7 +2231,7 @@ class Markdown(markdown.Markdown):
reg.register(StreamPattern(get_compiled_stream_link_regex(), self), "stream", 85)
reg.register(Timestamp(r"<time:(?P<time>[^>]*?)>"), "timestamp", 75)
reg.register(
- UserGroupMentionPattern(mention.user_group_mentions, self), "usergroupmention", 65
+ UserGroupMentionPattern(mention.USER_GROUP_MENTIONS_RE, self), "usergroupmention", 65
)
reg.register(LinkInlineProcessor(markdown.inlinepatterns.LINK_RE, self), "link", 60)
reg.register(AutoLink(get_web_link_regex(), self), "autolink", 55)
diff --git a/zerver/lib/mention.py b/zerver/lib/mention.py
index 42c48e4dc07..4c2e18ca4b8 100644
--- a/zerver/lib/mention.py
+++ b/zerver/lib/mention.py
@@ -4,7 +4,7 @@ from typing import Optional, Set, Tuple
# Match multi-word string between @** ** or match any one-word
# sequences after @
MENTIONS_RE = r"(?<![^\s\'\"\(,:<])@(?P<silent>_?)(?P<match>\*\*[^\*]+\*\*|all|everyone|stream)"
-user_group_mentions = r"(?<![^\s\'\"\(,:<])@(\*[^\*]+\*)"
+USER_GROUP_MENTIONS_RE = r"(?<![^\s\'\"\(,:<])@(\*[^\*]+\*)"
wildcards = ["all", "everyone", "stream"]
@@ -44,5 +44,5 @@ def extract_user_group(matched_text: str) -> str:
def possible_user_group_mentions(content: str) -> Set[str]:
- matches = re.findall(user_group_mentions, content)
+ matches = re.findall(USER_GROUP_MENTIONS_RE, content)
return {extract_user_group(match) for match in matches}