diff options
-rw-r--r-- | lib/redcarpet/render/gitlab_html.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 48b4da9d339..bd590f92734 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 |