Created
December 29, 2019 14:15
-
-
Save TopRoupi/c4c556ff42558ee2962fdfa5b0c89f82 to your computer and use it in GitHub Desktop.
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
module ApplicationHelper | |
def markdown(content) | |
return '' if content.blank? | |
markdown = Redcarpet::Markdown.new(Redcarpet::Render::XHTML, | |
autolink: true, | |
space_after_headers: true, | |
tables: true) | |
markdown.render(content) | |
sanitize(markdown.render(content)).html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment