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 CommonMark
|
|
|
|
class HTML < CommonMarker::HtmlRenderer
|
|
|
|
def code_block(node)
|
|
|
|
block do
|
2018-11-20 20:47:30 +05:30
|
|
|
out("<pre#{sourcepos(node)}><code")
|
|
|
|
out(' lang="', node.fence_info, '"') if node.fence_info.present?
|
|
|
|
out('>')
|
|
|
|
out(escape_html(node.string_content))
|
|
|
|
out('</code></pre>')
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|