diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index 4d9a5d1551..21b2b8b4f3 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -582,11 +582,11 @@ class AlertWordsNotificationProcessor(markdown.preprocessors.Preprocessor): # We check for a user's custom notifications here, as we want # to check for plaintext words that depend on the recipient. realm_words = alert_words.alert_words_in_realm(current_message.sender.realm) + content = '\n'.join(lines) for user, words in realm_words.iteritems(): for word in words: escaped = re.escape(word) match_re = re.compile(r'\b%s\b' % (escaped,)) - content = '\n'.join(lines) if re.search(match_re, content): current_message.user_ids_with_alert_words.add(user.id)