How to Link an Image in Markdown with its site

I'm looking for a image link format that contains website link that works in Obsidian. Something like this:

Is there a solution or I can only embed an image and simply paste a link under it

4 points · 6 comments · view on lemmy.world

6 Comments

zarlin@lemmy.dbzer0.com · 3 pts · 1y (3 replies)

You should be able to nest the image and link into each other like this:

 [![image alt text](image URL link)](anchor link)

This effectively uses the image instead of the link text.

Override4414@lemmy.world · 2 pts · 1y (2 replies)

sorry I should be more clear, I want to use local attachment link instead of image URL link, what link format should I use?

zarlin@lemmy.dbzer0.com · 1 pts · 1y (1 reply)

Ah you mean where the image link is formatted like ![[foo.png]]. I tried some things but it seems Obsidian doesn't support nesting those inside a link (eg [![[foo.png]]](example.com) is not accepted as valid formatting).

Override4414@lemmy.world · 2 pts · 1y

yeah that's the problem, I guess I will just simply past the original link right below the image

Emotional_Series7814@kbin.melroy.org · 1 pts · 1y (2 replies)

Not sure if this is what you want, but https://forum.obsidian.md/t/images-as-links/42030

Override4414@lemmy.world · 1 pts · 1y
[ removed ]
Override4414@lemmy.world · 1 pts · 1y

yes that's what I am looking for but it seems it only works in preview mode.