Created
December 29, 2019 14:14
-
-
Save TopRoupi/09f3635ac6bb0061109d12381f712ea0 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment