diff options
-rw-r--r-- | client/components/main/layouts.styl | 4 | ||||
-rw-r--r-- | models/activities.js | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl index 56c35284..01ce2f16 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -381,6 +381,10 @@ a display: block word-wrap: break-word + table + word-wrap: normal + word-break: normal + ol list-style-type: decimal padding-left: 20px diff --git a/models/activities.js b/models/activities.js index a864e5e4..dcabfbc2 100644 --- a/models/activities.js +++ b/models/activities.js @@ -180,7 +180,7 @@ if (Meteor.isServer) { const comment = activity.comment(); params.comment = comment.text; if (board) { - const atUser = /(?:^|>|\b|\s)@(\S+)(?:\s|$|<|\b)/g; + const atUser = /(?:^|>|\b|\s)@(\S+?)(?:\s|$|<|\b)/g; const comment = params.comment; if (comment.match(atUser)) { const commenter = params.user; @@ -192,12 +192,14 @@ if (Meteor.isServer) { } const atUser = Users.findOne(username) || Users.findOne({ username }); - const uid = atUser && atUser._id; - params.atUsername = username; - params.atEmails = atUser.emails; - if (board.hasMember(uid)) { - title = 'act-atUserComment'; - watchers = _.union(watchers, [uid]); + if (atUser && atUser._id) { + const uid = atUser._id; + params.atUsername = username; + params.atEmails = atUser.emails; + if (board.hasMember(uid)) { + title = 'act-atUserComment'; + watchers = _.union(watchers, [uid]); + } } } } |