Compare commits

..

1 commit

Author SHA1 Message Date
Sam Gleske
a8de515e9c
Merge 2084a81297 into 2fdafd34ca 2025-05-20 20:41:03 -04:00
2 changed files with 11 additions and 2 deletions

View file

@ -2,7 +2,6 @@ package router
import (
"errors"
"html"
"io"
"io/fs"
"reflect"
@ -116,7 +115,7 @@ func New(tmplDir fs.FS, extraData map[string]interface{}, secret [64]byte) *echo
//"htmlescaper": template.htmlEscaper,
funcs := template.FuncMap{
"StringsJoin": strings.Join,
"attrescaper": html.EscapeString,
"attrescaper": util.EscapeHtmlCode,
}
templates := make(map[string]*template.Template)
templates["login.html"] = template.Must(template.New("login").Funcs(funcs).Parse(tmplLoginString))

10
util/html.go Normal file
View file

@ -0,0 +1,10 @@
package util
import (
"html"
)
func EscapeHtmlCode(s string) string {
encodedString := html.EscapeString(s)
return encodedString
}