Sometimes when I'm working with Markdown in a Rails app, I'll be using different sets of redcarpet flags for different types of content. For example, I have images and links turned on for blog posts, but turned off for comments. Keeping track of all the variations can be difficult. I...
module MarkdownHelper
def render_markdown(content, mode)
sanitize(MarkdownRenderer.new(content, mode).render)
end
end