[FIX] mail: wrap to new line spaces to avoid bad mention detection
X-original-commit: dc15021752ec83d4f36127b1bf75bece1074757d
This commit is contained in:
@@ -510,7 +510,7 @@ function factory(dependencies) {
|
||||
* @returns {mail.partner[]}
|
||||
*/
|
||||
_computeMentionedPartners() {
|
||||
const inputMentions = this.textInputContent.replace(/\n/g, "\n ").match(
|
||||
const inputMentions = this.textInputContent.replace(/\n/g, " \n ").match(
|
||||
new RegExp("@[^ ]+(?= | |$)", 'g')
|
||||
) || [];
|
||||
const unmentionedPartners = [];
|
||||
@@ -533,7 +533,7 @@ function factory(dependencies) {
|
||||
* @returns {mail.partner[]}
|
||||
*/
|
||||
_computeMentionedChannels() {
|
||||
const inputMentions = this.textInputContent.replace('\n', "\n ").match(
|
||||
const inputMentions = this.textInputContent.replace(/\n/g, " \n ").match(
|
||||
new RegExp("#[^ ]+(?= | |$)", 'g')
|
||||
) || [];
|
||||
const unmentionedChannels = [];
|
||||
@@ -580,7 +580,7 @@ function factory(dependencies) {
|
||||
if (this.mentionedPartners.length === 0 && this.mentionedChannels.length === 0) {
|
||||
return body;
|
||||
}
|
||||
const inputMentions = body.replace(new RegExp('<br/>', 'g'), "<br/> ")
|
||||
const inputMentions = body.replace(new RegExp('<br/>', 'g'), " <br/> ")
|
||||
.match(new RegExp("(@|#)" + '[^ ]+(?= | |$)', 'g'))
|
||||
.filter(match => !match.endsWith("<br/>"));
|
||||
const substrings = [];
|
||||
|
||||
Reference in New Issue
Block a user