I needed a way to convert Markdown-formatted text to HTML without any line breaks for writing show notes for podcasts using the Driftwood platform, because it holds the shownotes in the YAML front matter. I wanted to be able to do this on both iOS and OS X.
I haven’t given up on TextExpander, yet1, and so far it is the only option I’m aware of in which I can sync the same macros across all my iOS and OS X devices.
The problem ended up being fairly simple2.
I took the minified version and created a TextExpander snippet of just that code.
Then I made the snippet for the conversion. It consists of only two lines of code. The first calls the Marked library:
and the second takes whatever is in the clipboard, runs it through the marked library, and then removes newlines:
It doesn’t get much simpler than that.