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

I was editing here.

Problem #1: the curious behavior of images with angle brackets in the alt-text

Post content:

![figure demonstrate the use of ->][1]

  [1]: http://i.stack.imgur.com/sUIH0.gif

Post rendered as: "> (Google Chrome)

Is this the expected behaviour?

I ampersand-escaped the > to get the image to appear.

Problem #2: redundant image hosting

When I add this image from the web, it creates a new copy 3joxV.gif on i.stack.imgur.com. Even if this is just a new identifier, this seems redundant.

enter image description here

share|improve this question

2 Answers 2

What's happening here is the first image gets rendered like this:

<img src="http://i.stack.imgur.com/sUIH0.gif" 
     alt="figure demonstrate the use of ->">

At which point, the HTML sanitizer gets its grubby mitts on it, thinks the first > is the end of the tag and says, "HEY! This doesn't look right... No, no no no, this doesn't look right at all - there's supposed to be a closing quotation mark before the end of the tag! I'm throwing this whole mess into the bit bucket."

...which leaves you with

">

The obvious solution is for the Markdown engine to do the same thing you would do if you were typing out the tag manually: escape any special characters in the alt text before inserting them into the output.

Related: Bug with images and markdown

Regarding the redundant image... You don't have to use the little "Insert an image" toolbar utility to put these in if you don't want to. If you already have an image hosted somewhere reliable (preferably on i.stack.imgur.com since we have some control over that and can prevent images from expiring...), you can just write out the Markdown directly and slap the existing image URL into it.

But it's not a big deal. Bytes are cheap.

share|improve this answer

Fixed now; angle brackets that end up in the alt (or title) attribute are now encoded. See Angle brackets in image alt texts should be auto-encoded.

share|improve this answer

You must log in to answer this question.

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