Skip to content

Commit

Permalink
🎨 Improve importing Markdown #13245
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 24, 2024
1 parent 4443f3e commit 8ea1361
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kernel/model/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8ea1361

Please sign in to comment.