Markdown + WordPress + MarsEdit
06 Sep 2011A little navel gazing here, mostly so that I can find this post again someday if I run into this problem.
I was trying to move to using Markdown as the syntax for my WordPress posts, basically just to make my life a bit easier. Markdown is basically just a way of writing HTML more quickly, easily, and readably than actually writing HTML. There's a nifty WordPress plugin called Markdown on Save that lets you use Markdown with Wordpress.
MarsEdit, the awesome app I already use to make my life a bit easier, supports rendering Markdown as a Preview, so you can make sure it's all coming together the way you'd like it to. And MarsEdit supports WordPress' custom fields, so, in theory, I could tie the little field that Markdown on Save uses into MarsEdit, and then write my posts here in Markdown, and razzle-dazzle, life would be grand, lollypop-eating puppies would be raining from the sky full of rainbows, etc., etc.
Except it doesn't work. Looks like in WordPress 3.1.3, the WP devs introduced the concept of a protected field (prefixed with an underscore) that can't be edited from outside the app. Of course, Markdown on Save uses one of those protected fields, so MarsEdit wouldn't work out of the box.
A bit of google-fu found this post, but hacking the corresponding code in for Markdown on Save didn't seem to work. Nor did hacking the Markdown on Save source itself to make its field not prefixed with an underscore. That worked for ticking the checkbox of the Markdown plugin, but seemed to make WordPress eat the content of the post.
I'm guessing if I spend a bit more time on it, I could probably figure out how to make it work. But that would defeat the purpose of having something that makes my life easier.
Update: So, after 30 minutes more of google-fu, of course I stumbled on a much beter solution. Install Markdown (or MultiMarkdown), setup a service, and then type up Markdown in MarsEdit, transform it with the service, and then publish as normal HTML.
In other words, don't bother with Markdown on Save.