fix: json escaping

This commit is contained in:
Henrique Dias 2026-03-28 19:54:21 +01:00
parent d9f9460c1e
commit c406bda0c7
No known key found for this signature in database

View file

@ -85,7 +85,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
return http.StatusInternalServerError, err
}
data["Json"] = strings.ReplaceAll(string(b), `'`, `\'`)
data["Json"] = template.JS(strings.ReplaceAll(string(b), `'`, `\'`))
fileContents, err := fs.ReadFile(fSys, file)
if err != nil {