Skip to content
Snippets Groups Projects
Commit d2767221 authored by Riyad Preukschas's avatar Riyad Preukschas
Browse files

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

parent 184a9eca
No related branches found
No related tags found
1 merge request!2095Fix code highlighting
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment