Skip to content

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

:art: Improve importing Markdown https://github.com/siyuan-note/siyuan/issues/13245

Daniel8ea1361f8252
diff --git a/kernel/model/box.go b/kernel/model/box.go
index 88a0b3713c..8c54414a32 100644
--- a/kernel/model/box.go
+++ b/kernel/model/box.go
@@ -604,18 +604,16 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
continue
}
- for i, tag := range attrV.([]any) {
- tagStr := strings.TrimSpace(tag.(string))
+ for _, tag := range attrV.([]any) {
+ tagStr := fmt.Sprintf("%v", tag)
if "" == tag {
continue
}
tagStr = strings.TrimLeft(tagStr, "#,'\"")
tagStr = strings.TrimRight(tagStr, "#,'\"")
- tags += tagStr
- if i < len(attrV.([]any))-1 {
- tags += ","
- }
+ tags += tagStr + ","
}
+ tags = strings.TrimRight(tags, ",")
tree.Root.SetIALAttr("tags", tags)
continue
}