Links and Message URIs

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

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

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


> <message://>


> Markdown yields:


> <p><message://></p>


> Shouldn't it have given instead:


> <p><a

> href="message://">message://</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.


Waylan Limberg
waylan at

More information about the Markdown-Discuss mailing list