Created
April 13, 2012 00:23
-
-
Save edwardloveall/2372221 to your computer and use it in GitHub Desktop.
Markdown helper for Redcarpet ~> 2.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_markdown(text) | |
md_renderer = Redcarpet::Render::HTML.new(:hard_wrap => true) | |
md_options = [:autolink => true] | |
markdown = Redcarpet::Markdown.new(md_renderer, *md_options) | |
markdown.render(text).html_safe | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment