Skip to content

Instantly share code, notes, and snippets.

@lozandier
Last active December 24, 2015 08:59
Show Gist options
  • Save lozandier/6774412 to your computer and use it in GitHub Desktop.
Save lozandier/6774412 to your computer and use it in GitHub Desktop.
class CustomRender < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
def block_code(code, language)
Pygments.highlight(code, lexer: language)
end
end
def markdown
@markdown ||= Redcarpet::Markdown.new CustomRender, {
autolink: true,
fenced_code: true,
generate_toc: true,
gh_blockcode: true,
hard_wrap: true,
no_intraemphasis: true,
strikethrough: true,
tables: true,
superscript: true
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment