mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
🎨 反链面板中文档标题在鼠标悬浮时显示文档完整路径 Fix https://github.com/siyuan-note/insider/issues/1088
This commit is contained in:
parent
1b0426b987
commit
39a3ac1fab
@ -317,7 +317,7 @@ func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode
|
|||||||
|
|
||||||
linkRefs, linkRefsCount, excludeBacklinkIDs := buildLinkRefs(rootID, refs)
|
linkRefs, linkRefsCount, excludeBacklinkIDs := buildLinkRefs(rootID, refs)
|
||||||
tmpBacklinks := toFlatTree(linkRefs, 0, "backlink")
|
tmpBacklinks := toFlatTree(linkRefs, 0, "backlink")
|
||||||
var boxIDs []string
|
|
||||||
for _, l := range tmpBacklinks {
|
for _, l := range tmpBacklinks {
|
||||||
l.Blocks = nil
|
l.Blocks = nil
|
||||||
if "" != keyword {
|
if "" != keyword {
|
||||||
@ -326,14 +326,6 @@ func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
backlinks = append(backlinks, l)
|
backlinks = append(backlinks, l)
|
||||||
boxIDs = append(boxIDs, l.Box)
|
|
||||||
}
|
|
||||||
boxIDs = gulu.Str.RemoveDuplicatedElem(boxIDs)
|
|
||||||
|
|
||||||
boxNames := Conf.BoxNames(boxIDs)
|
|
||||||
for _, l := range backlinks {
|
|
||||||
name := boxNames[l.Box]
|
|
||||||
l.HPath = name + "/" + l.HPath
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Slice(backlinks, func(i, j int) bool {
|
sort.Slice(backlinks, func(i, j int) bool {
|
||||||
@ -370,11 +362,6 @@ func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode
|
|||||||
backmentions = append(backmentions, l)
|
backmentions = append(backmentions, l)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, l := range backmentions {
|
|
||||||
name := boxNames[l.Box]
|
|
||||||
l.HPath = name + "/" + l.HPath
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Slice(backmentions, func(i, j int) bool {
|
sort.Slice(backmentions, func(i, j int) bool {
|
||||||
switch mentionSortMode {
|
switch mentionSortMode {
|
||||||
case util.SortModeUpdatedDESC:
|
case util.SortModeUpdatedDESC:
|
||||||
@ -398,6 +385,25 @@ func GetBacklink2(id, keyword, mentionKeyword string, sortMode, mentionSortMode
|
|||||||
})
|
})
|
||||||
|
|
||||||
mentionsCount = len(backmentions)
|
mentionsCount = len(backmentions)
|
||||||
|
|
||||||
|
// 添加笔记本名称
|
||||||
|
var boxIDs []string
|
||||||
|
for _, l := range backlinks {
|
||||||
|
boxIDs = append(boxIDs, l.Box)
|
||||||
|
}
|
||||||
|
for _, l := range backmentions {
|
||||||
|
boxIDs = append(boxIDs, l.Box)
|
||||||
|
}
|
||||||
|
boxIDs = gulu.Str.RemoveDuplicatedElem(boxIDs)
|
||||||
|
boxNames := Conf.BoxNames(boxIDs)
|
||||||
|
for _, l := range backlinks {
|
||||||
|
name := boxNames[l.Box]
|
||||||
|
l.HPath = name + l.HPath
|
||||||
|
}
|
||||||
|
for _, l := range backmentions {
|
||||||
|
name := boxNames[l.Box]
|
||||||
|
l.HPath = name + l.HPath
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user