Created
January 16, 2015 16:03
-
-
Save maier-stefan/10abf76200f48a0056d6 to your computer and use it in GitHub Desktop.
markdown with html pipeline
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 JobsHelper | |
def markdownify(content) | |
pipeline_context = {gfm:true, asset_root: "https://a248.e.akamai.net/assets.github.com/images/icons"} | |
pipeline = HTML::Pipeline.new [ | |
HTML::Pipeline::MarkdownFilter, | |
HTML::Pipeline::SanitizationFilter, | |
HTML::Pipeline::EmojiFilter | |
], pipeline_context | |
pipeline.call(content)[:output].to_s.html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment