mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve importing Markdown https://github.com/siyuan-note/siyuan/issues/13245
This commit is contained in:
parent
4443f3e929
commit
8ea1361f82
1 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue