Things I have tried
Does Obsidian automatically look in A/B.png, for example, in ![[B.png]] in A.md? Maybe I missed it, but I cannot find it documented anywhere.
It certainly behaves that way, which is nice because Dataview’s
=this.file.name only works in Preview mode.
I just want to get a clarification.
What I’m trying to do
So, if I understand correctly you are saying that you have B.png embedded within a note named A, and you are asking where Obsidian will look to find the B.png file. Assuming your vault has only one file named B.png, Obsidian will let you store and move that file anywhere within the vault, and the embed will stay correctly pointed to B.png regardless.
However, if you have more than one file named B.png located in different folders, and you have ‘Automatically update internal links’ turned on, and you have ’New link format’ set to ‘Shortest path when possible’, all links to the first B.png file will update to include its file path from the vault root. The same will occur for the the new link to the second B.png, but obviously with a different path.
I hope this answers your question. Something tells me I am misunderstanding what you are actually asking.
In terms of the question about the inline Dataview query only working in Preview mode, I am curious why you don’t have Live Preview enabled. As far as I know, it is enabled by default on the more recent releases. These queries will show without having to go into Preview mode assuming you have Live Preview enabled. @scholarInTraining correctly pointed out that I was mistaken here. Thanks.
At least for me, the one-liner inline dataview queries only show in reading mode, while the full codeblocks work in Live Preview. I believe that’s the expected behavior; are you seeing something different?
You are both right. My bad!
I was mistakenly thinking about Dataviewjs not the inline Dataview queries. I appreciate the heads up and will adjust my reply.