Module: Jekyll::Converters::Markdown::RedcarpetParser::WithPygments
- Includes:
- CommonMethods
- Defined in:
- lib/jekyll/converters/markdown/redcarpet_parser.rb
Instance Method Summary collapse
Methods included from CommonMethods
Instance Method Details
#block_code(code, lang) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/converters/markdown/redcarpet_parser.rb', line 15 def block_code(code, lang) require 'pygments' lang = lang && lang.split.first || "text" output = ( Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }), lang ) end |