From 558aea906aa47d1e6a808d0eede5dd865a5f4746 Mon Sep 17 00:00:00 2001 From: Craig Peterson Date: Wed, 28 Mar 2018 10:00:05 -0400 Subject: [PATCH] make bonfire notifications multiple posts for markdown compatibility --- pkg/notifications/bonfire.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/notifications/bonfire.go b/pkg/notifications/bonfire.go index d70a740ad..542977df9 100644 --- a/pkg/notifications/bonfire.go +++ b/pkg/notifications/bonfire.go @@ -27,7 +27,11 @@ func (b bonfireNotifier) Notify(domain, provider, msg string, err error, preview } else { payload = fmt.Sprintf(`Successfully ran correction for **%s[%s]** - %s`, domain, provider, msg) } - http.Post(string(b), "text/markdown", strings.NewReader(payload)) + // chat doesn't markdownify multiline messages. Split in two so the first line can have markdown + parts := strings.SplitN(payload, "\n", 2) + for _, p := range parts { + http.Post(string(b), "text/markdown", strings.NewReader(p)) + } } func (b bonfireNotifier) Done() {}