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

14 lines
284 B
Ruby
Raw Normal View History

module Banzai
module Renderer
class HTML < Redcarpet::Render::HTML
def block_code(code, lang)
lang_attr = lang ? %Q{ lang="#{lang}"} : ''
"\n<pre>" \
"<code#{lang_attr}>#{html_escape(code)}</code>" \
"</pre>"
end
end
end
end