|
|
|
@ -210,12 +210,12 @@ func runner(runtime phoenix.Runtime) error { |
|
|
|
|
|
|
|
|
|
|
|
// Load templates.
|
|
|
|
// Load templates.
|
|
|
|
templateFuncMap := template.FuncMap{ |
|
|
|
templateFuncMap := template.FuncMap{ |
|
|
|
"json": func(obj interface{}) (template.HTML, error) { |
|
|
|
"json": func(obj interface{}) (template.JS, error) { |
|
|
|
data, err := json.Marshal(obj) |
|
|
|
data, err := json.Marshal(obj) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return "", err |
|
|
|
return "", err |
|
|
|
} |
|
|
|
} |
|
|
|
return template.HTML(data), nil |
|
|
|
return template.JS(data), nil |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
templates = template.New("") |
|
|
|
templates = template.New("") |
|
|
|
|