Whitespace in img src

Lasar Liepins lasar at liepins.net
Mon Feb 25 17:11:52 EST 2008


Hi,


On 25.02.2008, at 22:38:17, Florian Lindner wrote:


> markdown (Python implementation) seems to render:

>

> ![alternativer text](pfad/und/eine lange/url zum bild.jpg)

>

> to

>

> <img src="pfad/und/eine" title="lange/url zum bild.jpg"

> alt="alternativer text"/>

>

> breaking the URL at the whitespace. AFAIK whitespaces are ok in URLs

> so why is it breaking up the URL here?


Yeah, I'd say the python implementation isn't expecting spaces in a
URL and in this case decides the rest of the URL belongs into the title.
Markdown.pl only does this when it encounters a ". It basically sees
this:

![alternativer text](pfad/und/eine "lange/url zum bild.jpg")



But while we're finding bugs(?) with the image syntax, Markdown.pl
converts this to

<p>!<a href="pfad/und/eine lange/url zum bild.jpg">alternativer text</
a></p>

And does so until all spaces are removed from the URL. Only then does
it get
rendered as <img>.

Arguably you could work around this by encoding all spaces as %20, but
then again
one might expect Markdown to do this.

Greetings,

_Lasar

--
_Lasar Liepins
lasar at liepins.net
http://liepins.net/
http://10110101.net/




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2550 bytes
Desc: not available
Url : <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20080225/d88697f2/attachment.bin>


More information about the Markdown-Discuss mailing list