holroy
January 11, 2024, 5:16pm
3
This is a larger issue with Dataview which often has issues with embeds. It seems that only the images can somewhat reliable be embedded from within a dataviewjs script.
opened 04:33PM - 04 Sep 23 UTC
bug
### What happened?
DataViewJS query below.
Once created or updated manually … - it is rendered as expected. Text after vertical bar is placed inside `alt` attribute of each embed.
When returning back to the page later or just spontaneously, it changes to rendering the alt text *in place of* the embed, as shown on screenshot:

In the edit mode, it is usually enough to enter and exit the line to refresh it.
In reading mode, it might require to close the tab or edit the page - just switching to edit mode and back might not be enough to reset it.
I would like it to be shown consistently.
I suspect there might be two different causes:
- either a race condition when something depends on how fast the call for actual content is returned;
- or there are different call types depending on whether actual content is required (for example, SNW plugin consistently shows the alt text for backlink previews because it doesn't need the content. Although I'd argue whether it should evaluate the line at all...), and the wrong call type is used erroneously on update.
I'm not completely sure this is a DataView issue, but I can't reproduce it outside of DataView.
(Note: I'm trying to use alt text as an easy workaround for styling purposes)
Edit: Neither alt text nor heading section seem significant for the issue reproduction. On some update event the transclusion content is eventually replaced with a placeholder, default one if no alt text is provided.
### DQL
_No response_
### JS
```js
for (let dailyPage of dv.pages('"journal"').sort(p => p.file.name, "desc").slice(0,7)) {
dv.el("div", dailyPage.file.link);
dv.el("div", "![[" + dailyPage.file.name + "#Report|trimmed]]")
}
```
Also happens like this, with default placeholder text:
```js
for (let dailyPage of dv.pages('"journal"').sort(p => p.file.name, "desc").slice(0,7)) {
dv.el("div", dailyPage.file.link);
dv.el("div", "![[" + dailyPage.file.name + "]]")
}
```
### Dataview Version
0.5.56
### Obsidian Version
1.4.5
### OS
Windows
Where the author of Dataview says:
Dataview delegates to Obsidian markdown rendering which will not render transclusions at all, sadly.