Skip to main content
2 of 8
added 157 characters in body; edited title
Jason S
  • 6.4k
  • 2
  • 33
  • 38

recommended syntax for an image with a link

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:

alt text http://www.gravatar.com/avatar/dd5a7ef1476fb01998a215b1642dfd07?s=128&d=identicon&r=PG

These work properly:

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

Jason S
  • 6.4k
  • 2
  • 33
  • 38