Class: Banzai::Renderer::CommonMark::HTML

Inherits:
CommonMarker::HtmlRenderer
  • Object
show all
Defined in:
lib/banzai/renderer/common_mark/html.rb

Instance Method Summary collapse

Instance Method Details

#code_block(node) ⇒ Object


7
8
9
10
11
12
13
14
15
# File 'lib/banzai/renderer/common_mark/html.rb', line 7

def code_block(node)
  block do
    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>')
  end
end