@@ -1303,22 +1303,30 @@ Client.find_backlinks_async = function(self, note, callback, opts)
1303
1303
search_terms [# search_terms + 1 ] = string.format (" [[%s|" , ref )
1304
1304
-- Markdown link without anchor/block.
1305
1305
search_terms [# search_terms + 1 ] = string.format (" (%s)" , ref )
1306
+ -- Markdown link without anchor/block and is relative to root.
1307
+ search_terms [# search_terms + 1 ] = string.format (" (/%s)" , ref )
1306
1308
-- Wiki links with anchor/block.
1307
1309
search_terms [# search_terms + 1 ] = string.format (" [[%s#" , ref )
1308
1310
-- Markdown link with anchor/block.
1309
1311
search_terms [# search_terms + 1 ] = string.format (" (%s#" , ref )
1312
+ -- Markdown link with anchor/block and is relative to root.
1313
+ search_terms [# search_terms + 1 ] = string.format (" (/%s#" , ref )
1310
1314
elseif anchor then
1311
1315
-- Note: Obsidian allow a lot of different forms of anchor links, so we can't assume
1312
1316
-- it's the standardized form here.
1313
1317
-- Wiki links with anchor.
1314
1318
search_terms [# search_terms + 1 ] = string.format (" [[%s#" , ref )
1315
1319
-- Markdown link with anchor.
1316
1320
search_terms [# search_terms + 1 ] = string.format (" (%s#" , ref )
1321
+ -- Markdown link with anchor and is relative to root.
1322
+ search_terms [# search_terms + 1 ] = string.format (" (/%s#" , ref )
1317
1323
elseif block then
1318
1324
-- Wiki links with block.
1319
1325
search_terms [# search_terms + 1 ] = string.format (" [[%s#%s" , ref , block )
1320
1326
-- Markdown link with block.
1321
1327
search_terms [# search_terms + 1 ] = string.format (" (%s#%s" , ref , block )
1328
+ -- Markdown link with block and is relative to root.
1329
+ search_terms [# search_terms + 1 ] = string.format (" (/%s#%s" , ref , block )
1322
1330
end
1323
1331
end
1324
1332
end
0 commit comments