Play nice with Markdown

Written early in the evening in English • Tags: , , ,

I’ve created a couple of small patches to improve how WordPress works with Markdown:

  • markdown-balancetags.diff

    The balanceTags function was preventing the Markdown autotags feature from working by thinking <http://server/page> is actually some sorf of an http tag. I didn’t want to completely disable balanceTags, so I added code to pass through http, https and ftp “tags” untouched.

  • markdown-first.diff

    The wptexturize function must be called after Markdown to avoid unwanted “texturizing” of preformatted and code blocks. The fix was easy once I learned that filters have priorities. The default priority is 10, so I modified markdown.php to install itself at priority 8.

I’m beginning to think I should import WordPress to my local CVS repository.