What's the recommended syntax for an image with a hyperlink? I tried doing it with the markdown toolbar buttons and the image and link buttons conflict with each other, so I had to resort to HTML.

For example, to do this:

<a href="http://meta.stackoverflow.com/users/44330/jason-s">![alt text][1]</a>


These work properly:

 <a href="http://meta.stackoverflow.com/users/44330/jason-s">![alt text][1]</a>
 [1]: https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG

 <a href="http://meta.stackoverflow.com/users/44330/jason-s">
 <img src="https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG">
 </a>

 [<img src="https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG">][2]
 [2]: http://meta.stackoverflow.com/users/44330/jason-s

This does not:

 <a href='http://meta.stackoverflow.com/users/44330/jason-s'>![alt text][1]</a>

(single quotes not allowed?)

Is there a way to do the same thing in Markdown without having to resort to HTML?



 [1]: https://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG


[Return to FAQ index](/q/7931)