gitlab-org--gitlab-foss/lib/banzai/renderer/redcarpet/html.rb

16 lines
341 B
Ruby
Raw Normal View History

2018-03-07 07:14:41 -05:00
module Banzai
module Renderer
module Redcarpet
class HTML < ::Redcarpet::Render::HTML
def block_code(code, lang)
lang_attr = lang ? %Q{ lang="#{lang}"} : ''
"\n<pre>" \
2018-04-17 05:39:11 -04:00
"<code#{lang_attr}>#{ERB::Util.html_escape(code)}</code>" \
2018-03-07 07:14:41 -05:00
"</pre>"
end
end
end
end
end