🐛 Overlay block ref on PDF annotation ref lead to failure to query unreferenced assets https://github.com/siyuan-note/siyuan/issues/8186

This commit is contained in:
Liang Ding 2023-05-06 15:23:48 +08:00
parent f6750f2657
commit 9e17a2f1da
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -729,6 +729,10 @@ func assetsLinkDestsInTree(tree *parse.Tree) (ret []string) {
return ast.WalkContinue
}
if !strings.Contains(n.TextMarkFileAnnotationRefID, "/") {
return ast.WalkSkipChildren
}
dest := n.TextMarkFileAnnotationRefID[:strings.LastIndexByte(n.TextMarkFileAnnotationRefID, '/')]
dest = strings.TrimSpace(dest)
ret = append(ret, dest)