benbalter/word-to-markdown-demo — pull request #3 by Benjamin-Dobell (2014-10-26 13:50:21+00:00)
Title: Escape HTML characters (e.g. < >) in Markdown output

HTML characters were rendered correctly (i.e. escaped) in the HTML output on the right, but the Markdown output on the left didn't escape them. So some text like C++ templates (or static_casts) were not displayed correctly e.g. std::list was output as std::list, with the "" component omitted, as "int" is not a valid HTML tag.

This patch simply HTML escapes the rendered markdown using the method suggested in the the Sinatra FAQ - http://www.sinatrarb.com/faq.html#escape_html