Skip to content

Instantly share code, notes, and snippets.

@maier-stefan
Created January 16, 2015 16:03
Show Gist options
  • Save maier-stefan/10abf76200f48a0056d6 to your computer and use it in GitHub Desktop.
Save maier-stefan/10abf76200f48a0056d6 to your computer and use it in GitHub Desktop.
markdown with html pipeline
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