From 7b9feb60ac8fafbb1eccf6dd5bab2263f1fe4cd2 Mon Sep 17 00:00:00 2001 From: epwalsh Date: Fri, 26 Jul 2024 12:55:25 -0700 Subject: [PATCH] Fixed an edge case with collecting backlinks Fixes #663. --- CHANGELOG.md | 4 ++++ lua/obsidian/client.lua | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3efd1bef..b5a2801ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `opts.follow_img_func` option for customizing how to handle image paths. +### Fixed + +- Fixed an edge case with collecting backlinks. + ## [v3.9.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.9.0) - 2024-07-11 ### Added diff --git a/lua/obsidian/client.lua b/lua/obsidian/client.lua index 226eb5ebb..00c09c77f 100644 --- a/lua/obsidian/client.lua +++ b/lua/obsidian/client.lua @@ -1310,7 +1310,8 @@ Client.find_backlinks_async = function(self, note, callback, opts) -- Prepare search terms. local search_terms = {} - for raw_ref in iter { tostring(note.id), note:fname(), self:vault_relative_path(note.path) } do + local note_path = Path.new(note.path) + for raw_ref in iter { tostring(note.id), note_path.name, note_path.stem, self:vault_relative_path(note.path) } do for ref in iter(util.tbl_unique { raw_ref,