Links and Message URIs

Waylan Limberg waylan at gmail.com
Wed Nov 19 22:12:54 EST 2008


On Wed, Nov 19, 2008 at 8:50 PM, Mark Eli Kalderon
<eli at markelikalderon.com> wrote:

> Here is a OS X message URI in angled brackets:

>

> <message://%3cE1KzXg9-0000Qb-3G@smtp1.mail.ox.ac.uk%3e>

>

> Markdown yields:

>

> <p><message://%3cE1KzXg9-0000Qb-3G@smtp1.mail.ox.ac.uk%3e></p>

>

> Shouldn't it have given instead:

>

> <p><a

> href="message://%3cE1KzXg9-0000Qb-3G@smtp1.mail.ox.ac.uk%3e">message://%3cE1KzXg9-0000Qb-3G@smtp1.mail.ox.ac.uk%3e</a></p>

>


Actually, it (sort of) does in a few implementations [1] . I can't
speak for the others, but is works in python as a fluck. You see, the
regex will only match the 3 schemes; ``http://``, ``https://``, &
``ftp://`` as well as email addresses. As it turns out, the email
regex for this case is rather dumb in the Python implementation and
looks for any string between angle brackets (``< >``) that has an
``@`` in it. It just so happens that your example message does. That's
why its encoded as html entities rather than plain text. Discount
appears to behave the same. It looks like PEG Markdown is the only
implementation that gives you what you want.

Presumably most are seeing it as raw html and passing it through
untouched, which explains why the angle brackets are not escaped. Only
Pandoc escapes the brackets - which I would think is more correct that
raw html treatment in this case. However, it is an obscure enough edge
case, that the code would have to special case for it to not see it as
raw html, that I wouldn't expect it to never work consistently.


[1]: http://babelmark.bobtfish.net/?markdown=%3Cmessage%3A%2F%2F%253cE1KzXg9-0000Qb-3G%40smtp1.mail.ox.ac.uk%253e%3E&src=1&dest=2



--
----
Waylan Limberg
waylan at gmail.com


More information about the Markdown-Discuss mailing list