What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

I noticed some weird behavior of Markdown regarding adding hyperlinks to images.

Start with an image:

![alt text][1]


  [1]: http://example.com/image.jpg

Now, highlight ![alt text][1] and hit Ctrl+L (add a hyperlink). instead of the expected prompt for hyperlink URL, you just get:

alt text

In other words, the reference to the image URL is gone entirely!


Now, let's say you manually entered that link, then added another paragraph:

[![alt text][1]][2]

second paragraph

  [1]: http://example.com/image.jpg
  [2]: http://example.com/page1.html

Now you want "second paragraph" to be a link, so you highlight it, hit Ctrl+L, and enter http://example.com/page2.html as the URL and hit OK. You get this:

[![alt text][1]][1]

[second paragraph][2]


  [1]: http://example.com/page1.html
  [2]: http://example.com/page2.html

Notice that the URL to the image has been completely removed!

share|improve this question
    
I think you mean meta.stackexchange.com/questions/56460/… –  balpha Nov 27 '10 at 21:06
    
@balpha you're right, i had too many tabs open and copied the wrong url –  Kip Nov 27 '10 at 23:30
    
Part 2 of this is a dup of meta.stackexchange.com/questions/56460/…, which is now [status-completed] –  Kip Nov 27 '10 at 23:30
    
You know it's over when Atwood adds the status tag. –  Cole Johnson Oct 1 '13 at 2:33

1 Answer 1

Er.. what? You want an image src = an HTML page?

Images as links work fine..

Markup

[![alt text][1]][2]

second paragraph

  [1]: http://cdn.sstatic.net/stackexchange/img/logos/so/so-logo.png
  [2]: http://stackoverflow.com

Output

alt text

second paragraph

share|improve this answer
4  
He's right though, it doesn't work with the WMD buttons or the keyboard shortcuts. –  balpha Jan 18 '10 at 16:45
    
it's open source. You want it that bad, go for it.. code.google.com/p/wmd-new –  Jeff Atwood Jan 18 '10 at 16:52
6  
i thought i explained it in a pretty clear step-by-step manner. there were two things. First: You have a post with an image. I want to make the image a clickable link. it doesn't work (with shortcut or toolbar button). Second: assuming you managed to manually create the image with hyperlink above it. if try to add another regular link in the next paragraph using the keyboard shortcut or toolbar, the reference to the image is deleted, and now you have img src=html page, which is not what should be there. –  Kip Jan 18 '10 at 17:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .