mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🐛 Markdown import fails when tag is empty https://github.com/siyuan-note/siyuan/issues/13382
This commit is contained in:
parent
ee1043514b
commit
a1fdad7e0a
1 changed files with 5 additions and 2 deletions
|
|
@ -596,7 +596,7 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if "tags" == attrK {
|
if "tags" == attrK && nil != attrV {
|
||||||
var tags string
|
var tags string
|
||||||
if str, ok := attrV.(string); ok {
|
if str, ok := attrV.(string); ok {
|
||||||
tags = strings.TrimSpace(str)
|
tags = strings.TrimSpace(str)
|
||||||
|
|
@ -614,7 +614,10 @@ func normalizeTree(tree *parse.Tree) (yfmRootID, yfmTitle, yfmUpdated string) {
|
||||||
tags += tagStr + ","
|
tags += tagStr + ","
|
||||||
}
|
}
|
||||||
tags = strings.TrimRight(tags, ",")
|
tags = strings.TrimRight(tags, ",")
|
||||||
|
tags = strings.TrimSpace(tags)
|
||||||
|
if "" != tags {
|
||||||
tree.Root.SetIALAttr("tags", tags)
|
tree.Root.SetIALAttr("tags", tags)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue