make bonfire notifications multiple posts for markdown compatibility
@@ -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() {}
