mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 00:23:49 +00:00
Match alert words inside markup.
We now will match an alert word even if it is used at the boundry of bolding, backtick escaping, or caret quoting. Closes trac #2186. (imported from commit 984bc63eb621772c95a01ca5c5bfeb190767f71f)
This commit is contained in:
@@ -770,8 +770,8 @@ class AlertWordsNotificationProcessor(markdown.preprocessors.Preprocessor):
|
||||
realm_words = db_data['realm_alert_words']
|
||||
content = '\n'.join(lines).lower()
|
||||
|
||||
allowed_before_punctuation = "|".join([r'\s', '^', r'[\(\".,\';\[]'])
|
||||
allowed_after_punctuation = "|".join([r'\s', '$', r'[\)\"\?:.,\';\]!]'])
|
||||
allowed_before_punctuation = "|".join([r'\s', '^', r'[\(\".,\';\[\*`>]'])
|
||||
allowed_after_punctuation = "|".join([r'\s', '$', r'[\)\"\?:.,\';\]!\*`]'])
|
||||
|
||||
for user_id, words in realm_words.iteritems():
|
||||
for word in words:
|
||||
|
||||
Reference in New Issue
Block a user