diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index 48b4da9d..bd590f92 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -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