This commit is contained in:
Daniel 2024-09-19 22:18:43 +08:00
parent 3cd7d9fd3e
commit 0ff99f758a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 19 additions and 8 deletions

View file

@ -42,7 +42,7 @@ import (
func RenderGoTemplate(templateContent string) (ret string, err error) {
tmpl := template.New("")
tplFuncMap := util.BuiltInTemplateFuncs()
tplFuncMap := treenode.BuiltInTemplateFuncs()
sql.SQLTemplateFuncs(&tplFuncMap)
tmpl = tmpl.Funcs(tplFuncMap)
tpl, err := tmpl.Parse(templateContent)
@ -224,7 +224,7 @@ func RenderTemplate(p, id string, preview bool) (tree *parse.Tree, dom string, e
}
goTpl := template.New("").Delims(".action{", "}")
tplFuncMap := util.BuiltInTemplateFuncs()
tplFuncMap := treenode.BuiltInTemplateFuncs()
sql.SQLTemplateFuncs(&tplFuncMap)
goTpl = goTpl.Funcs(tplFuncMap)
tpl, err := goTpl.Funcs(tplFuncMap).Parse(gulu.Str.FromBytes(md))