# Image alt text render error when using link (with final rendering different than preview)

When you declare an image the usual way it works:

![alt text][1]


With links as alt text it works as well:

![http://x][1]


But when you use a - before a link:

![- http://x][1]


It does not render the image and generates an invalid HTML text output instead (with final rendering different than preview (thanks @animuson)):

• When in preview the rendered text is http://x" title="" />.
• In the final post, the rendered text is http://x">. See it below:

http://x">

Anything else works: ![- http://][1], ![- bla][1], ![- http:/x][1].

• That difference is just because when you don't enter a title, one Markdown engine creates empty title attributes, while the other one creates none at all. – balpha Jun 11 '13 at 6:31

This is most likely the auto-linkifier acting up again. A [ character is not a valid preceder for auto-linkification. A space character, however, is. Apparently a ] is also a valid end character that stops a hyperlink (or perhaps it's seeing the end of the string depending on what order things get processed), so your ![- http://x][1] ends up looking like this after it runs through Markdown:

<img src="<a href="http://x">http://x</a>" title="" />


Once that runs through the sanitizer to remove invalid HTML:

<img src="<a href="http://x">http://x</a>" title="" />

and that's how you end up with the odd result in the rendering.

Note: Oddly enough, the title attribute only seems to get added in the post preview as you're typing, but doesn't get added in the final rendering of the post. shrugs

• +1: Good catch on pointing out the difference in preview and final rendered text! I didnt notice it! – acdcjunior Jun 11 '13 at 5:16