From ecd856a401e2172ec8f7a131e209feb99e13338a Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Wed, 20 Apr 2016 16:14:40 +0200 Subject: [PATCH] Add safeHtml template function. Fixes https://github.com/prometheus/alertmanager/issues/314 --- template/template.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/template.go b/template/template.go index 550e2b95..5b65ce14 100644 --- a/template/template.go +++ b/template/template.go @@ -127,6 +127,9 @@ var DefaultFuncs = FuncMap{ "join": func(sep string, s []string) string { return strings.Join(s, sep) }, + "safeHtml": func(text string) tmplhtml.HTML { + return tmplhtml.HTML(text) + }, } // Pair is a key/value string pair.