mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-7473 Ignore text surrounded by multiple backquotes when parsing mentions (#7347)
This commit is contained in:
committed by
Saturnino Abril
parent
c8d51b6465
commit
98bb4c31a1
@@ -842,7 +842,7 @@ func GetExplicitMentions(message string, keywords map[string][]string) (map[stri
|
||||
var codeBlockPattern = regexp.MustCompile("(?m)^[^\\S\n]*\\`\\`\\`.*$[\\s\\S]+?(^[^\\S\n]*\\`\\`\\`$|\\z)")
|
||||
|
||||
// Matches a backquote, either some text or any number of non-empty lines, and then a final backquote
|
||||
var inlineCodePattern = regexp.MustCompile("(?m)\\`(?:.+?|.*?\n(.*?\\S.*?\n)*.*?)\\`")
|
||||
var inlineCodePattern = regexp.MustCompile("(?m)\\`+(?:.+?|.*?\n(.*?\\S.*?\n)*.*?)\\`+")
|
||||
|
||||
// Strips pre-formatted text and code blocks from a Markdown string by replacing them with whitespace
|
||||
func removeCodeFromMessage(message string) string {
|
||||
|
||||
Reference in New Issue
Block a user