From b8e8aa0593576563e9c462df3e18900fb3ec41d6 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 11 Oct 2023 17:00:21 +0800 Subject: [PATCH 1/2] :hammer: Clean code --- app/appx/AppxManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/appx/AppxManifest.xml b/app/appx/AppxManifest.xml index a0eebcba7..800bfd753 100644 --- a/app/appx/AppxManifest.xml +++ b/app/appx/AppxManifest.xml @@ -8,7 +8,7 @@ SiYuan From 92151f71504332d96456f52087423ba967c02f78 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 12 Oct 2023 10:12:44 +0800 Subject: [PATCH 2/2] :art: Change database template column custom attribute action Fix https://github.com/siyuan-note/siyuan/issues/9401 --- kernel/model/attribute_view.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 0f14c3c22..eefa01562 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -51,7 +51,6 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av funcMap := sprig.TxtFuncMap() goTpl := template.New("").Delims(".action{", "}") - tplContent = strings.ReplaceAll(tplContent, ".custom-", ".custom_") // 模板中的属性名不允许包含 - 字符,因此这里需要替换 tpl, tplErr := goTpl.Funcs(funcMap).Parse(tplContent) if nil != 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{} dataModel := map[string]interface{}{} // 复制一份 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 createdStr := ial["id"]