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
|
end
|
||||||
|
|
||||||
def block_code(code, language)
|
def block_code(code, language)
|
||||||
|
options = { options: {encoding: 'utf-8'} }
|
||||||
|
|
||||||
if Pygments::Lexer.find(language)
|
if Pygments::Lexer.find(language)
|
||||||
Pygments.highlight(code, lexer: language, options: {encoding: 'utf-8'})
|
Pygments.highlight(code, options.merge(lexer: language.downcase))
|
||||||
else
|
else
|
||||||
Pygments.highlight(code, options: {encoding: 'utf-8'})
|
Pygments.highlight(code, options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue