javalent / obsidian-leaflet

Adds interactive maps to Obsidian.md using Leaflet.js
468 stars 26 forks source link

[Bug]: LinksTo doesn't work with YAML wikilinks in Obsidian 1.4 #414

Open kepano opened 11 months ago

kepano commented 11 months ago

Check for existing bug reports before submitting.

Expected Behavior

Obsidian 1.4 adds support for internal links https://obsidian.md/changelog/2023-07-26-desktop-v1.4.0/

It appears that the query is not correctly accessing the links in YAML. Dataview does seem to be able to access these though.

Current behaviour

LinksTo does not display notes that are linked to the specified note

Reproduction

Example query

id: tokyo
linksTo: [[Tokyo]]

Note content

---
location: [139.7657382, 35.6712864]
city: '[[Tokyo]]'
---

Which Operating Systems are you using?

Obsidian Version Check

1.4.2

Plugin Version

5.7.2

Confirmation

Possible solution

No response

valentine195 commented 11 months ago

The plugin uses Obsidian’s API to resolve linksTo / linksFrom:

https://github.com/javalent/obsidian-leaflet/blob/866c4d77f672fff9f300306efa255ff3ef58032e/src/renderer/renderer.ts#L989

which then uses Dataview to get the link map.

If Dataview’s API changed, I’ll have to resync it.

valentine195 commented 10 months ago

@kepano I did some testing of this this morning, and Leaflet successfully identifies the file. I looked at the DV cache and this setup is not created as an in-link to the Tokyo file. I think this is an issue with Dataview.

KiljanK commented 10 months ago

As far as i'm aware, this is a Dataview issue indeed.

There has been a recent PR to fix this issue, but it failed two tests.

I don't know how long this usually takes, but this looks like a good sign :)

EDIT: It has just been fixed in the most recent release