mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 20:08:49 +01:00
🎨 Add template func pow, powf, log and logf https://github.com/siyuan-note/siyuan/issues/9911
This commit is contained in:
parent
9e14e24efb
commit
7fa8111313
2 changed files with 26 additions and 15 deletions
|
|
@ -29,7 +29,6 @@ import (
|
|||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
"github.com/siyuan-note/dejavu/entity"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/logging"
|
||||
|
|
@ -412,9 +411,9 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
|
|||
ial["updated"] = time.UnixMilli(block.Block.Updated).Format("20060102150405")
|
||||
}
|
||||
|
||||
funcMap := sprig.TxtFuncMap()
|
||||
goTpl := template.New("").Delims(".action{", "}")
|
||||
tpl, tplErr := goTpl.Funcs(funcMap).Parse(tplContent)
|
||||
goTpl = goTpl.Funcs(builtInTemplateFuncs())
|
||||
tpl, tplErr := goTpl.Parse(tplContent)
|
||||
if nil != tplErr {
|
||||
logging.LogWarnf("parse template [%s] failed: %s", tplContent, tplErr)
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue