Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 调用模板时模板名首字符乱码 Fix https://github.com/siyuan-note/siyuan/issues/7049

Liang Ding1642ec53a2dd
diff --git a/kernel/model/template.go b/kernel/model/template.go
index dab07ae1ea..5a11cc4d52 100644
--- a/kernel/model/template.go
+++ b/kernel/model/template.go
@@ -96,7 +96,7 @@ func SearchTemplate(keyword string) (ret []*Block) {
content := strings.TrimPrefix(path, templates)
content = strings.TrimSuffix(content, ".md")
content = filepath.ToSlash(content)
- content = content[1:]
+ content = strings.TrimPrefix(content, "/")
_, content = search.MarkText(content, keyword, 32, Conf.Search.CaseSensitive)
b := &Block{Path: path, Content: content}
templateBlocks = append(templateBlocks, b)
@@ -115,7 +115,6 @@ func SearchTemplate(keyword string) (ret []*Block) {
content := group.Name()
content = strings.TrimSuffix(content, ".md")
content = filepath.ToSlash(content)
- content = content[1:]
_, content = search.MarkText(content, keyword, 32, Conf.Search.CaseSensitive)
b := &Block{Path: filepath.Join(templates, group.Name()), Content: content}
ret = append(ret, b)