Several gems can compile Markdown syntax to HTML. For our template handler, let’s use RDiscount, which is a Ruby wrapper to the fast Markdown compiler library called Discount, written in C.
We can create a template handler that compiles to Markdown in just a couple lines of code. Let’s first add another test to our suite:
test ".md template handler" do
expected = "<p>RDiscount is <em>cool</em> and <strong>fast</strong>!</p>"
assert_match expected, response.body
And then let’s write our template in the filesystem: