diff --git a/docs/overview/changelog.md b/docs/overview/changelog.md index 90243d0854..25d894ddc3 100644 --- a/docs/overview/changelog.md +++ b/docs/overview/changelog.md @@ -61,7 +61,7 @@ in bursts. - Added a ReviewBoard integration, and improved numerous existing integrations. - Added support for multi-line messages for the /me feature. - Added markdown rendering of text when displaying custom profile fields. -- Added "silent mentions" syntax (`_@**Tim Abbott**`), which show +- Added "silent mentions" syntax (`@_**Tim Abbott**`), which show visually, but don't trigger a notification to the target user. - Added support for using lightbox in compose preview. - Changes in date no longer force a repeated recipient bar. This diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index 96156d41bc..ed6783b93b 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -302,7 +302,7 @@ run_test('marked', () => { expected: '
:poop:
'}, {input: '\u{1f6b2}', expected: '\u{1f6b2}
' }, - {input: 'Silent mention: _@**Cordelia Lear**', + {input: 'Silent mention: @_**Cordelia Lear**', expected: 'Silent mention: @Cordelia Lear
'}, {input: '> Mention in quote: @**Cordelia Lear**\n\nMention outside quote: @**Cordelia Lear**', expected: '\n\nMention in quote: @Cordelia Lear
\n
Mention outside quote: @Cordelia Lear
'}, diff --git a/static/third/marked/lib/marked.js b/static/third/marked/lib/marked.js index 98f3ad0287..a30d6ce0dc 100644 --- a/static/third/marked/lib/marked.js +++ b/static/third/marked/lib/marked.js @@ -509,7 +509,7 @@ inline.zulip = merge({}, inline.breaks, { '\ud83d[\ude80-\udeff]|\ud83e[\udd00-\uddff]|' + '[\u2000-\u206F]|[\u2300-\u27BF]|[\u2B00-\u2BFF]|' + '[\u3000-\u303F]|[\u3200-\u32FF])'), - usermention: /^((_?)@(?:\*\*([^\*]+)\*\*))/, // Match potentially multi-word string between @** ** + usermention: /^(@(_?)(?:\*\*([^\*]+)\*\*))/, // Match potentially multi-word string between @** ** groupmention: /^@\*([^\*]+)\*/, // Match multi-word string between @* * stream: /^#\*\*([^\*]+)\*\*/, avatar: /^!avatar\(([^)]+)\)/, diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 55b90134f2..2b9f9eaf03 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -254,7 +254,7 @@ def send_signup_message(sender: UserProfile, admin_realm_signup_notifications_st "stream", signup_notifications_stream.name, "signups", - "_@**%s|%s** just signed up for Zulip. (total: %i)" % ( + "@_**%s|%s** just signed up for Zulip. (total: %i)" % ( user_profile.full_name, user_profile.id, user_count ) ) @@ -3491,7 +3491,7 @@ def do_rename_stream(stream: Stream, sender, stream, "welcome", - "_@**%s|%d** renamed stream **%s** to **%s**" % (user_profile.full_name, + "@_**%s|%d** renamed stream **%s** to **%s**" % (user_profile.full_name, user_profile.id, old_name, new_name) ) diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index c76e41d7c2..61aa272ca7 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -1358,7 +1358,7 @@ class BlockQuoteProcessor(markdown.blockprocessors.BlockQuoteProcessor): def clean(self, line: str) -> str: # Silence all the mentions inside blockquotes - line = re.sub(self.mention_re, lambda m: "_@{}".format(m.group('match')), line) + line = re.sub(self.mention_re, lambda m: "@_{}".format(m.group('match')), line) # And then run the upstream processor's code for removing the '>' return super().clean(line) diff --git a/zerver/lib/mention.py b/zerver/lib/mention.py index 858db3d94b..4ccc18c2a4 100644 --- a/zerver/lib/mention.py +++ b/zerver/lib/mention.py @@ -5,7 +5,7 @@ import re # Match multi-word string between @** ** or match any one-word # sequences after @ -find_mentions = r'(?_?)@(?P