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
1 changed files with 4 additions and 1 deletions

View File

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