From 8d508184821a68dd8fa3ab89863abdbf683a92b9 Mon Sep 17 00:00:00 2001 From: kotkovkirill Date: Wed, 16 Oct 2024 13:39:33 +0200 Subject: [PATCH] fix --- pkg/services/ngalert/notifier/channels/slack.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/services/ngalert/notifier/channels/slack.go b/pkg/services/ngalert/notifier/channels/slack.go index 669fbf751f20f..36d37aa00d749 100644 --- a/pkg/services/ngalert/notifier/channels/slack.go +++ b/pkg/services/ngalert/notifier/channels/slack.go @@ -355,7 +355,9 @@ func (sn *SlackNotifier) SendResolved() bool { func (sn *SlackNotifier) minify(src []byte) string { dst := &bytes.Buffer{} if err := json.Compact(dst, []byte(src)); err != nil { - return strings.ReplaceAll(string(src), "\n", "") + r := strings.NewReplacer("\n", "","\"", " ") + return r.Replace(string(src)) } - return dst.String() + + return strings.ReplaceAll(dst.String(), "\"", " ") }