Class: MarkdownToHtml::HTMLWithPygments

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Includes:
Redcarpet::Render::SmartyPants
Defined in:
lib/markdown_to_html.rb

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



10
11
12
13
14
# File 'lib/markdown_to_html.rb', line 10

def block_code(code, language)
  options = { :encoding => 'utf-8'}
  options[:lexer] = language unless language.nil? 
  Pygments.highlight(code, options)
end