mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🎨 Add a template function getHPathByID https://github.com/siyuan-note/siyuan/issues/11734
This commit is contained in:
parent
3cd7d9fd3e
commit
0ff99f758a
3 changed files with 19 additions and 8 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue