mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f0f55d3b02
2 changed files with 2 additions and 3 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
<!-- use single quotes to avoid double quotes escaping in the publisher value -->
|
<!-- use single quotes to avoid double quotes escaping in the publisher value -->
|
||||||
<Identity Name="89C2A984.SiYuan"
|
<Identity Name="89C2A984.SiYuan"
|
||||||
ProcessorArchitecture="x64"
|
ProcessorArchitecture="x64"
|
||||||
Publisher='CN=087C656E-C1D9-42D8-8807-CED45A74FC0F'
|
Publisher="CN=087C656E-C1D9-42D8-8807-CED45A74FC0F"
|
||||||
Version="2.10.10.0"/>
|
Version="2.10.10.0"/>
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>SiYuan</DisplayName>
|
<DisplayName>SiYuan</DisplayName>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
|
||||||
|
|
||||||
funcMap := sprig.TxtFuncMap()
|
funcMap := sprig.TxtFuncMap()
|
||||||
goTpl := template.New("").Delims(".action{", "}")
|
goTpl := template.New("").Delims(".action{", "}")
|
||||||
tplContent = strings.ReplaceAll(tplContent, ".custom-", ".custom_") // 模板中的属性名不允许包含 - 字符,因此这里需要替换
|
|
||||||
tpl, tplErr := goTpl.Funcs(funcMap).Parse(tplContent)
|
tpl, tplErr := goTpl.Funcs(funcMap).Parse(tplContent)
|
||||||
if nil != tplErr {
|
if nil != tplErr {
|
||||||
logging.LogWarnf("parse template [%s] failed: %s", tplContent, tplErr)
|
logging.LogWarnf("parse template [%s] failed: %s", tplContent, tplErr)
|
||||||
|
|
@ -61,7 +60,7 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
dataModel := map[string]interface{}{} // 复制一份 IAL 以避免修改原始数据
|
dataModel := map[string]interface{}{} // 复制一份 IAL 以避免修改原始数据
|
||||||
for k, v := range ial {
|
for k, v := range ial {
|
||||||
dataModel[strings.ReplaceAll(k, "custom-", "custom_")] = v
|
dataModel[k] = v
|
||||||
|
|
||||||
// Database template column supports `created` and `updated` built-in variables https://github.com/siyuan-note/siyuan/issues/9364
|
// Database template column supports `created` and `updated` built-in variables https://github.com/siyuan-note/siyuan/issues/9364
|
||||||
createdStr := ial["id"]
|
createdStr := ial["id"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue