mirror of https://github.com/zulip/zulip.git
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:
parent
d7e4429bb7
commit
4ebc4a4ef1
|
@ -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 + ')' +
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue