gitlab-org--gitlab-foss/lib/banzai/renderer/redcarpet/html.rb
2018-04-17 11:39:11 +02:00

15 lines
341 B
Ruby

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