This commit is contained in:
Daniel 2024-11-24 10:38:10 +08:00
parent 4443f3e929
commit 8ea1361f82
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}