Skip to content

Commit

Permalink
🐛 调用模板时模板名首字符乱码 Fix #7049
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 12, 2023
1 parent f1b3914 commit 1642ec5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/model/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 1642ec5

Please sign in to comment.