Expand characters allowed after an alertword.

We now support .';[ before a word and ';]! after.

Closes trac #2283.

(imported from commit b3e3cb3d8d49a8e74d0b6a108c5ec73e9d9b5f32)
This commit is contained in:
Luke Faraone 2014-02-12 17:36:09 -05:00
parent d7e4429bb7
commit 4ebc4a4ef1
2 changed files with 4 additions and 4 deletions

View File

@ -17,8 +17,8 @@ exports.process_message = function (message) {
_.each(exports.words, function (word) {
var clean = escape_user_regex(word);
var before_punctuation = '\\s|^|>|[\\(\\"]';
var after_punctuation = '\\s|$|<|[\\)\\"\\?:.,]';
var before_punctuation = '\\s|^|>|[\\(\\".,\';\\[]';
var after_punctuation = '\\s|$|<|[\\)\\"\\?!:.,\';\\]!]';
var regex = new RegExp('(' + before_punctuation + ')' +
'(' + clean + ')' +

View File

@ -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: