Fix html/template string escaping of catalog JSON using safeJS

This commit is contained in:
lucio committed 2026-05-21 02:33:28 -07:00
1 parent 92ebb0f65a
commit 50fdae8bb8
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -22,6 +22,9 @@ var templates *template.Template
var templateMap map[string]*template.Template
var templateFuncs = template.FuncMap{
"safeJS": func(s string) template.JS {
return template.JS(s)
},
"formatPrice": func(p any) string {
switch v := p.(type) {
case float64:
+1 -1
View File
@@ -436,7 +436,7 @@
<script>
// Parse catalog JSON data dynamically injected by handler
const catalog = {{.CatalogJSON}};
const catalog = {{safeJS .CatalogJSON}};
let currentStep = 1;
let selectedCategory = null;