Fix code blocks in Markdown not knowing about the user's color scheme
This commit is contained in:
parent
184a9ecaf6
commit
d2767221a5
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue