fix pygments failures, fall back to just <pre>

This commit is contained in:
John Bintz 2012-07-05 15:57:46 -04:00
parent 5fa59b1f76
commit 211c703e76

View File

@ -9,7 +9,10 @@ class Sharkfrown
class PygmentizeHTML < Redcarpet::Render::HTML class PygmentizeHTML < Redcarpet::Render::HTML
def block_code(code, language) def block_code(code, language)
require 'pygmentize' require 'pygmentize'
Pygmentize.process(code, language) result = Pygmentize.process(code, language)
result = "<pre>#{code}</pre>" if result.empty?
result
end end
end end