8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/jekyll-commonmark/html_renderer.rb', line 8
def code_block(node)
block do
lang = (node.fence_info)
out('<div class="')
out("language-", lang, " ") if lang
out('highlighter-rouge"><div class="highlight">')
out("<pre", sourcepos(node), ' class="highlight"')
if option_enabled?(:GITHUB_PRE_LANG)
out_data_attr(lang)
out("><code>")
else
out("><code")
out_data_attr(lang)
out(">")
end
out(render_with_rouge(node.string_content, lang))
out("</code></pre></div></div>")
end
end
|