diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-09-04 09:31:20 -0400 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-09-04 21:31:20 +0800 |
commit | 98bb4c31a1eca362e6052075b12fa2dc5ab2a47d (patch) | |
tree | 2247efb50cec547351d3a93fb815223ce1a0b370 /app/notification.go | |
parent | c8d51b64656383c294339b2a2b353f48e07f8b03 (diff) | |
download | chat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.tar.gz chat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.tar.bz2 chat-98bb4c31a1eca362e6052075b12fa2dc5ab2a47d.zip |
PLT-7473 Ignore text surrounded by multiple backquotes when parsing mentions (#7347)
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/notification.go b/app/notification.go index af7589934..b0a5d83ad 100644 --- a/app/notification.go +++ b/app/notification.go @@ -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 { |