Class: GitHubParser::HTMLWithPantsRenderer

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Includes:
Redcarpet::Render::SmartyPants
Defined in:
lib/devcenter-parser/github_parser.rb

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/devcenter-parser/github_parser.rb', line 7

def block_code(code, language)
  if language
    language.sub!(/\Alang(uage)?-/, '')
    %{<pre class="language-#{language}"><code class="language-#{language}">#{html_escape(code)}</code></pre>}
  else
    %{<pre><code>#{html_escape(code)}</code></pre>}
  end
end