use text/template to avoid HTML escaping

Co-authored-by: Roy O'Young <roy2220@outlook.com>

Closes #57
This commit is contained in:
Will Norris
2021-07-29 00:25:56 -07:00
parent 058aeeb7be
commit b431030b15
4 changed files with 12 additions and 4 deletions

View File

@@ -16,9 +16,9 @@ package main
import (
"errors"
"html/template"
"os"
"testing"
"text/template"
)
func init() {
@@ -170,6 +170,14 @@ func TestExecuteTemplate(t *testing.T) {
"/*", " * ", "*/",
"/*\n * HYS\n*/\n\n",
},
// ensure we don't escape HTML characters by using the wrong template package
{
"{{.Holder}}",
licenseData{Holder: "A&Z"},
"", "", "",
"A&Z\n\n",
},
}
for _, tt := range tests {