MM-9868 Fixed mentioning users when followed by multiple periods (#8548)
* MM-9868 Fixed mentioning users when followed by multiple periods * Added additional unit test * Added comment to clarify test purpose
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cffb891854
Коммит
088f76ad6e
@@ -892,8 +892,17 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit
|
||||
}
|
||||
|
||||
// remove trailing '.', as that is the end of a sentence
|
||||
word = strings.TrimSuffix(word, ".")
|
||||
if checkForMention(word) {
|
||||
foundWithSuffix := false
|
||||
|
||||
for strings.HasSuffix(word, ".") {
|
||||
word = strings.TrimSuffix(word, ".")
|
||||
if checkForMention(word) {
|
||||
foundWithSuffix = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if foundWithSuffix {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user