Possible bug in Markdown.pl with `<<` handling

John Gruber gruber at fedora.net
Wed Sep 13 13:57:54 EDT 2006


Fletcher T. Penney <fletcher at alumni.duke.edu> wrote on 9/13/06 at 6:29 AM:


> Perhaps I am ignoring something obvious - but when does `<<` ever

> occur in XHTML? Shouldn't it be a safe assumption that Markdown

> should convert any string of multiple `<`'s in a row into `&lt;`'s?


This is perhaps a contrived example, but if someone put this in a
Markdown document:

<<?php print "p";?>>

they might reasonably expect the output to be:

<p>

not:

&lt;&lt;?php print "p";?&gt;&gt;

We can't have it both ways. The current "if it looks like a tag,
Markdown treats it as a tag" rule seems simpler and more obvious
to me than your proposed "if it looks like a tag, it's treated as
a tag, unless the angle brackets are in a consecutive run of other
angle brackets, in which case they're all treated as literal angle
brackets" rule.

-J.G.


More information about the Markdown-Discuss mailing list