markdown2 vs python-markdown

I'm using markdown for formatting my blog, and was having real issues with code samples generated by tohtml.com being formatted incorrectly by the library django.contrib.markup uses for markdown, python-markdown. So I thought I'd trial markdown2.

Here's the difference...

python-markdown

Code formatted incorrectly

Not only does it insert paragraphs inside <pre> blocks, and then create inline <pre> blocks, but for some reason, it messes with my indentation as well, never a good look when posting Python samples.

markdown2

Code formatted correctly

Kudos to Trent Mick, the author of markdown2. I've wrapped markdown2 in a Django template filter that works pretty much like the markdown filter, I'll make it available as soon as I write the capacity for file downloads into the blog.

Published: 3rd January, 2009