mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 13:07:17 -04:00
Fixing @user in comments doesn't work if it's in a separate line
This commit is contained in:
parent
753d5b953d
commit
e0046032e8
2 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue