diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 3d233517..cdd50c15 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -24,7 +24,6 @@ require 'English' # 3rd party require 'liquid' require 'maruku' -require 'pygments' require 'colorator' # internal requires diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index 92d8aec9..0f6f82de 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -9,6 +9,8 @@ module Jekyll @config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true } @renderer ||= Class.new(Redcarpet::Render::HTML) do + require 'pygments' + def block_code(code, lang) lang = lang && lang.split.first || "text" output = add_code_tags( diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb index c84ea111..e8059edb 100644 --- a/lib/jekyll/tags/highlight.rb +++ b/lib/jekyll/tags/highlight.rb @@ -49,6 +49,8 @@ eos end def render_pygments(context, code) + require 'pygments' + @options[:encoding] = 'utf-8' output = add_code_tags(