RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: bcarreno
Site: http://www.carreno.me/
Albino has been deprecated in favor of pygments.rb. This code combines both redcarpet 2.1 and pygments.rb
module ApplicationHelper class HTMLwithPygments < Redcarpet::Render::HTML def block_code(code, language) Pygments.highlight(code, :lexer => language) end end def markdown(text) renderer = HTMLwithPygments.new(:hard_wrap => true) options = { :fenced_code_blocks => true, :no_intra_emphasis => true, :autolink => true, :strikethrough => true, :lax_html_blocks => true, :superscript => true } Redcarpet::Markdown.new(renderer, options).render(text) end end
Albino has been deprecated in favor of pygments.rb. This code combines both redcarpet 2.1 and pygments.rb