summaryrefslogtreecommitdiff
path: root/lib/banzai/renderer/redcarpet/html.rb
blob: 30e815f1224332e36d83309397dff6a8d6832abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Banzai
  module Renderer
    module Redcarpet
      class HTML < ::Redcarpet::Render::HTML
        def block_code(code, lang)
          lang_attr = lang ? %Q{ lang="#{lang}"} : ''

          "\n<pre>" \
            "<code#{lang_attr}>#{ERB::Util.html_escape(code)}</code>" \
          "</pre>"
        end
      end
    end
  end
end