Fix 500s because of "missing" lexer
This commit is contained in:
parent
6cec9ed328
commit
ca54d43f99
|
@ -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…
Reference in a new issue