From 322e24a0284186efad8af92c2baaae65839ec72d Mon Sep 17 00:00:00 2001 From: Conflux Date: Sat, 11 May 2024 10:53:43 +0800 Subject: [PATCH] fix telegram markdown --- alert/templates.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alert/templates.go b/alert/templates.go index d609f9f..6c28b4c 100644 --- a/alert/templates.go +++ b/alert/templates.go @@ -58,9 +58,9 @@ var ( {{.Msg | escapeMarkdown}} {{with .Error}}*Reason* -{{.Error | escapeMarkdown}}{{ end }} +{{.Error | escapeMarkdown}} -{{ if .CtxFields }}*Context Fields*:{{ range $Key, $Val := .CtxFields }} +{{else}}{{ end }}{{ if .CtxFields }}*Context Fields*:{{ range $Key, $Val := .CtxFields }} *{{$Key | escapeMarkdown}}*: {{$Val | escapeMarkdown}}{{ end }}{{ end }} `, }