Skip to content
Snippets Groups Projects
Commit ca54d43f authored by Riyad Preukschas's avatar Riyad Preukschas
Browse files

Fix 500s because of "missing" lexer

parent 6cec9ed3
No related branches found
No related tags found
1 merge request!1949Add a link to commit path on notes button (commit list)
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment