Welcome to mirror list, hosted at ThFree Co, Russian Federation.

html.rb « common_mark « renderer « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b27316da1b5d5c90eaabd142af5449e90e13745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Banzai
  module Renderer
    module CommonMark
      class HTML < CommonMarker::HtmlRenderer
        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
      end
    end
  end
end