obsidian-dataview: Inline queries don't handle embedded image links

What happened?

Embedded image links are handled correctly by list and table dataviews, but not by inline queries.

Obsidian_Dataview_02

DQL

---
image-embed: "![[Obsidian.png]]"
---

`= this.image-embed`

JS

No response

Dataview Version

0.5.17

Obsidian Version

0.14.6

OS

Windows

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 9
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I can concur. I’ve been banging my head against the keyboard trying to get embed() to work. I have the note and the image in the same folder. I’ve tried with the yaml both with and without the braces.

---
image: "[[ScreenShot.png]]"
---
## This works as expected, so it knows where the image is and can display it normally
![image](ScreenShot.png)

## Shows the name as a link and hovering will show the image
`= link("ScreenShot.png")`

## Just shows the name as text, not a link any more
`= embed(link("ScreenShot.png"))`

## As expected, shows the name as a link and hovering will show the image
`= link(this.image)`

## embed() fails again; Just shows the name as text, not a link any more
`= embed(link(this.image))`

@pstelzer , I’m aware of the dataview workaround. However, as shown in my above example, I’m trying to put the picture inside of an MD table. Unfortunately, that means I cannot use solutions that are multi-line.

@scottmc42, I actually wanted to use it for the same usecase as you do. The suggestion from @fwolf didn’t work for me either. Neither did any form of embed(). The current workaround I’m using is via TABLE (also works with LIST). Borrowing from your example:

---
image: "![[truumble-token.png]]"
---

```dataview
TABLE WITHOUT ID
    this.image AS "Portrait" 
WHERE file.name = this.file.name
```

This also works with scaled images, e.g.:

---
image-wxh: "![[truumble-token.png|50x50]]"
image-w: "![[truumble-token.png|50]]"
---

The WHERE clause is necessary to prevent the table from fetching all files with the ‘image’ attribute.