提交 d2767221 编写于 作者: R Riyad Preukschas

Fix code blocks in Markdown not knowing about the user's color scheme

上级 184a9eca
......@@ -12,10 +12,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def block_code(code, language)
options = { options: {encoding: 'utf-8'} }
if Pygments::Lexer.find(language)
Pygments.highlight(code, options.merge(lexer: language.downcase))
else
Pygments.highlight(code, options)
h.content_tag :div, class: h.user_color_scheme_class do
if Pygments::Lexer.find(language)
Pygments.highlight(code, options.merge(lexer: language.downcase))
else
Pygments.highlight(code, options)
end.html_safe
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册