Commit d2767221 authored by Riyad Preukschas's avatar Riyad Preukschas

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

parent 184a9eca
...@@ -12,10 +12,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -12,10 +12,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def block_code(code, language) def block_code(code, language)
options = { options: {encoding: 'utf-8'} } options = { options: {encoding: 'utf-8'} }
h.content_tag :div, class: h.user_color_scheme_class do
if Pygments::Lexer.find(language) if Pygments::Lexer.find(language)
Pygments.highlight(code, options.merge(lexer: language.downcase)) Pygments.highlight(code, options.merge(lexer: language.downcase))
else else
Pygments.highlight(code, options) Pygments.highlight(code, options)
end.html_safe
end end
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