markdown: Require double-asterisk around all mentions.

This enforces `**` around all the mentions including "at-all" and
"at-everyone" mentions. Hence this makes `@all` and `@everyone`
invalid mentions, resulting into proper syntax for these mentions as
`@**all**` and `@**everyone**` respectively.

Note from tabbott: This removes an old feature/syntax, which made
sense back when @Tim was also a way to mention a user with Tim as
their first name.  Given how nice typeahead is now, the user part of
the feature was removed a while ago; this should have gone at the same
time.

Fixes: #8143.
This commit is contained in:
Shubham Dhama
2018-01-24 21:48:07 +05:30
committed by Tim Abbott
parent 55feafb513
commit a32e1eb913
8 changed files with 80 additions and 39 deletions

View File

@@ -198,7 +198,7 @@ exports.CachedValue.prototype = {
};
exports.is_all_or_everyone_mentioned = function (message_content) {
var all_everyone_re = /(^|\s)(@\*{2}(all|everyone)\*{2})|(@(all|everyone))($|\s)/;
var all_everyone_re = /(^|\s)(@\*{2}(all|everyone)\*{2})($|\s)/;
return all_everyone_re.test(message_content);
};