debian-mirror-gitlab/lib/banzai/renderer/redcarpet/html.rb

18 lines
372 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2018-03-27 19:54:05 +05:30
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-10-15 14:42:47 +05:30
"<code#{lang_attr}>#{ERB::Util.html_escape(code)}</code>" \
2018-03-27 19:54:05 +05:30
"</pre>"
end
end
end
end
end