diff --git a/blogit.gemspec b/blogit.gemspec index 79467f37..b1373684 100644 --- a/blogit.gemspec +++ b/blogit.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.add_dependency 'redcarpet', ">=2.0.1" s.add_dependency 'nokogiri', '>= 1.5.0' s.add_dependency "albino", ">=1.3.3" + s.add_dependency "pygmentize" s.add_dependency "kaminari", '>=0.13.0' s.add_dependency "jquery-rails" s.add_dependency "acts-as-taggable-on", "~> 3.5.0" diff --git a/lib/blogit/renderers/html_with_albino.rb b/lib/blogit/renderers/html_with_albino.rb index d5c4b38c..ba8d8686 100644 --- a/lib/blogit/renderers/html_with_albino.rb +++ b/lib/blogit/renderers/html_with_albino.rb @@ -1,8 +1,10 @@ # Create a custom renderer that allows highlighting of code blocks class Redcarpet::Render::HTMLWithAlbino < Redcarpet::Render::HTML - + def block_code(code, language) - Albino.colorize(code, language) + # Albino.colorize(code, language) + require "pygmentize" + Pygmentize.process(code, language.to_sym) end - -end \ No newline at end of file + +end