Friday, March 19, 2004 [Tweets] [Favorites]

Markdown 1.0b3

I don’t plan to use Markdown, John Gruber’s Setext-on-steriods Perl script. I’m already using reStructuredText, which is more extensible and supports multiple output formats. However, there are still some reasons that I find Markdown interesting.

First, the syntax is extremely clean. It looks only slightly more structured than e-mail or Setext, hardly at all resembling the troff-like Textile that it’s often compared with.

Second, Markdown is unabashedly designed only for producing (X)HTML. It supports inline chunks of HTML without the need to escape anything.

Third, the code. It’s formatted and commented well. Rather than separating the parsing and output phases by building a rich internal representation, it follows the common Perl style of treating text transformation as a series of regex substitutions. Perhaps this is because Perl’s syntax encourages the uses of regexes and discourages the use of references. Or perhaps it’s because this approach is expedient when the only output format is HTML. In any case, the decision to make the internal representation a string led to some code that made me laugh out loud. You see, you can’t really repress references. If you need them, they’ll come back in another form: in this case as MD5 digests that stand in for chunks of protected text.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment