Mixing inline, reference with image links

William Jackson william at subtlecoolness.com
Sat Apr 16 11:30:57 EDT 2005


One of these things is not like the other. I ran this through the dingus 
(1.0.2b2):

---

reference image, reference link:
[![alt text][img]][link]

reference image, inline link:
[![alt text][img]](http://example.com/)

inline image, inline link:
[![alt text](/path/to/img.jpg)](http://example.com/)

inline image, reference link:
[![alt text](/path/to/img.jpg)][link]

[img]: /path/to/img.jpg
[link]: http://example.com/

---

and this is what I got:

---

<p>reference image, reference link: <br />
<a href="http://example.com/"><img src="/path/to/img.jpg" alt="alt text" 
/></a></p>

<p>reference image, inline link: <br />
<a href="http://example.com/"><img src="/path/to/img.jpg" alt="alt text" 
/></a></p>

<p>inline image, inline link: <br />
<a href="http://example.com/"><img src="/path/to/img.jpg" alt="alt text" 
title="" /></a></p>

<p>inline image, reference link: <br />
<a href="/path/to/img.jpg"><img src="http://example.com/" alt="alt 
text</a>" /></p>

---

The fourth example, where the image source is specified inline and the 
link target is specified reference, isn't correct.

Since I discovered this (in WordPress 1.5, PHP-MarkDown 1.0.1), I have 
since changed my linking style to all-reference, but I wanted to alert 
everyone of this bug anyway.

William Jackson



More information about the Markdown-Discuss mailing list