mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🐛 Wrong count for hierarchical level tag count https://github.com/siyuan-note/siyuan/issues/8915
This commit is contained in:
parent
5ac4734b43
commit
b54c05cf88
1 changed files with 6 additions and 2 deletions
|
|
@ -321,7 +321,9 @@ func labelTags() (ret map[string]Tags) {
|
||||||
func appendTagChildren(tags *Tags, labels map[string]Tags) {
|
func appendTagChildren(tags *Tags, labels map[string]Tags) {
|
||||||
for _, tag := range *tags {
|
for _, tag := range *tags {
|
||||||
tag.Label = tag.Name
|
tag.Label = tag.Name
|
||||||
tag.Count = len(labels[tag.Label]) + 1
|
if _, ok := labels[tag.Label]; ok {
|
||||||
|
tag.Count = len(labels[tag.Label]) + 1
|
||||||
|
}
|
||||||
appendChildren0(tag, labels)
|
appendChildren0(tag, labels)
|
||||||
sortTags(tag.Children)
|
sortTags(tag.Children)
|
||||||
}
|
}
|
||||||
|
|
@ -331,7 +333,9 @@ func appendChildren0(tag *Tag, labels map[string]Tags) {
|
||||||
sortTags(tag.tags)
|
sortTags(tag.tags)
|
||||||
for _, t := range tag.tags {
|
for _, t := range tag.tags {
|
||||||
t.Label = tag.Label + "/" + t.Name
|
t.Label = tag.Label + "/" + t.Name
|
||||||
t.Count = len(labels[t.Label]) + 1
|
if _, ok := labels[t.Label]; ok {
|
||||||
|
t.Count = len(labels[t.Label]) + 1
|
||||||
|
}
|
||||||
tag.Children = append(tag.Children, t)
|
tag.Children = append(tag.Children, t)
|
||||||
}
|
}
|
||||||
for _, child := range tag.tags {
|
for _, child := range tag.tags {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue