obsidian-dataview
obsidian-dataview copied to clipboard
Meta method results differ
What happened?
While trying out some stuff, I noticed that the meta
method doesn't seem to work correctly for me when running through an array of links (generated by outlinks
), c.f. a single link:
To set up the test, I created some outlinks:
[[Proxmox]]
[[Pry]]
[[PopOS]]
[Ceph](Ceph)
[[Ruby's Self|self]]
In this example the PopOS
page doesn't currently exist, all the other ones do.
The meta().path
method works as expected.
= map(this.file.outlinks, (x) => meta(x).path)
#=> MOCs/Proxmox.md, Knowledge/Pry.md, PopOS, MOCs/Ceph.md, Knowledge/Ruby's Self.md
However, the meta().display
method didn't work with an explictlyly named link (I expected [[Ruby's Self|self]]
to show self
, but it just returned -
). I'm not sure why.
= map(this.file.outlinks, (x) => meta(x).display)
#=> -, -, -, -, -
I double checked with
= meta([[Ruby's Self|self]]).display
#=> self
That worked fine.
DQL
= map(this.file.outlinks, (x) => meta(x).display)
JS
No response
Dataview Version
0.5.36
Obsidian Version
0.14.15
OS
MacOS
Good catch. Can repro.
This is because file.outlinks
and file.inlinks
strip duplicates and display names on links - since you can link to the same page a bunch of times and name it different things.
There is a new file.links
variable incoming which just literally preserves every link in a page + it's display soon.