mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01: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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tag := range attrV.([]any) {
|
for _, tag := range attrV.([]any) {
|
||||||
tagStr := strings.TrimSpace(tag.(string))
|
tagStr := fmt.Sprintf("%v", tag)
|
||||||
if "" == tag {
|
if "" == tag {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
tagStr = strings.TrimLeft(tagStr, "#,'\"")
|
tagStr = strings.TrimLeft(tagStr, "#,'\"")
|
||||||
tagStr = strings.TrimRight(tagStr, "#,'\"")
|
tagStr = strings.TrimRight(tagStr, "#,'\"")
|
||||||
tags += tagStr
|
tags += tagStr + ","
|
||||||
if i < len(attrV.([]any))-1 {
|
|
||||||
tags += ","
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
tags = strings.TrimRight(tags, ",")
|
||||||
tree.Root.SetIALAttr("tags", tags)
|
tree.Root.SetIALAttr("tags", tags)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue