I'm trying to use CodeRay in my project and it seems to be working, however the style and formatting seems to be messed:
Note that I'm using CodeRay in conjunction with Markdown (Redcarpet). I've added both gems in my gemfile and in the app/helpers/application_helper.rb
I've added the following:
class CodeRayify < Redcarpet::Render::HTML
def block_code(code, language)
CodeRay.scan(code, language).div(:line_numbers => :inline)
end
end
def markdown(text)
coderayified = CodeRayify.new(:filter_html => true, :hard_wrap => true)
language ||= :plaintext
options = {
:fenced_code_blocks => true,
:no_intra_emphasis => false,
:autolink => true,
:strikethrough => true,
:lax_html_blocks => true,
:superscript => true
}
markdown_to_html = Redcarpet::Markdown.new(coderayified, options)
markdown_to_html.render(text).html_safe
end
Which does work as you can see by the screenshot attached. The problem is the formatting though. Any ideas?