Re: Formal Grammar — some thoughts

Michel Fortin michel.fortin at
Mon Jul 31 15:10:39 EDT 2006

Le 30 juil. 2006 à 18:50, A. Pagaltzis a écrit :

>> I recognize that md5 hashes are somewhat overkill for this

>> process. In fact, any alphanumeric string which isn't present

>> in the input text is suitable for "tokens".


> If “isn’t present in the input text” were easy, I’m pretty sure

> John would have done that. But it’s not. Using MD5 hashes means

> the chance that there’ll be a conflict remains present, but is so

> extremely slim as to be dismissible.

It's not as hard at it seems. For instance, you could check at the
beginning for the longest sequence of consecutive "x"s in the input,
then make your pseudo-tokens always begin with the same string but
with one more "x".

>> This is far from having a formal grammar, but it shows that a

>> lot more could be done by reusing the current approach.


> I guess if all you want to do is implement the exact purpose

> of, ie converting a Markdown document to an HTML

> fragment, then that is true.

Now that I'm rereading myself, I said *a lot more* in the sense that
more could be done regarding the nested element problem than what
Markdown does right now, not about other things other approaches
could achieve. But I admit I wasent clear. Surely different
implementations will be better at different things.

Michel Fortin
michel.fortin at

More information about the Markdown-Discuss mailing list