Hi,
First of all I am not very experienced in markdown and couldn’t find a good answer for what I am looking to do or if this is possible currently.
When I write texts, I would like to be able to put in an image and when clicked let it redirect to te relevant article or website that describes the image.
Is it possible to embed an image (whether inline or referenced) and make that image redirect to a different URL?
I am trying to get my head around what you say: are you referring to something like
[![img alt description](image URI)](URL of the resource)
This will take an image and turn it into a hyperlink. Is it something that you are asking?
I worded myself badly.
What I wanted to do was to embed a logo (e.g. a company logo) and that logo should act as a hyperlink to the company’s website.
The answer above does exactly that
It really sounds a bit complitcated.
Thank you for the explanation.
Now it makes a bit more sense on why exactly this syntax works since all this is doing is just embedding an image as the Link text for that link.
The Markdown in this case is more complicated than the HTML because Markdown optimizes simplicity for the overwhelmingly common case it targets (articles/content, not wrapping web page chrome). A website logo that links to the homepage is typically done in the wrapping template or even in the CSS, not in each page’s content.
HTML is sometimes more optimal for nested markup. Sometimes nesting makes Markdown hard to parse for humans or for machines, as @jgmhas pointed out. But mostly only in corner cases. Mostly.
So I think the Markdown syntax complexity in this case is fine. This is not an example of a Markdown flaw.
[![homepage]]
[homepage]: http://commonmark.org/help/images/favicon.png
[![homepage]]: http://commonmark.org "Redirect to Homepage"
This doesn’t work in Commonmark because we don’t allow unescaped brackets in link labels.
I don’t entirely recall the reasons for this, but it’s something we could reconsider, since I agree that this is a nice syntax for this case, and it works in many other implementations.