Commit ca54d43f authored by Riyad Preukschas's avatar Riyad Preukschas

Fix 500s because of "missing" lexer

parent 6cec9ed3
......@@ -10,10 +10,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment