From fa19a1746b5e475288ffa6dae85b3ca68f9e5ad8 Mon Sep 17 00:00:00 2001 From: adnano Date: Sat, 8 May 2021 20:28:42 -0400 Subject: [PATCH] Add html function for rendering HTML in templates --- config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.go b/config.go index 4ba9dfa..778c548 100644 --- a/config.go +++ b/config.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "html/template" "os" "path" "strings" @@ -78,6 +79,9 @@ func (c *Config) LoadTemplates(path string) error { } return b.String(), nil }, + "html": func(s string) template.HTML { + return template.HTML(s) + }, }) return c.templates.Load(path) }