Permalink
Browse files

Fix 500s because of "missing" lexer

  • Loading branch information...
1 parent 6cec9ed commit ca54d43f9900666ff86fb4c647f9f9441eec781a @riyad riyad committed Nov 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/redcarpet/render/gitlab_html.rb
@@ -10,10 +10,12 @@ def initialize(template, options = {})
end
def block_code(code, language)
+ options = { options: {encoding: 'utf-8'} }
+
if Pygments::Lexer.find(language)
- Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'})
+ Pygments.highlight(code, options.merge(lexer: language.downcase))
else
- Pygments.highlight(code, options: {encoding: 'utf-8'})
+ Pygments.highlight(code, options)
end
end

0 comments on commit ca54d43

Please sign in to comment.