Commit cec866a7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve wiki rendering. Fix pygemnt + markdown invalid html

parent ed35ea70
...@@ -43,11 +43,15 @@ ...@@ -43,11 +43,15 @@
padding: 0 4px; padding: 0 4px;
} }
padding: 20px; padding: 20px;
h1, h2 {
line-height: 46px; h1 { font-size: 26px; line-height: 46px; }
} h2 { font-size: 22px; line-height: 42px; }
h3, h4 { h3 { font-size: 20px; line-height: 40px; }
line-height: 40px; h4 { font-size: 18px; line-height: 32px; }
h5 { font-size: 16px; line-height: 26px; }
.white .highlight pre {
background: #f5f5f5;
} }
} }
......
...@@ -11,14 +11,13 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -11,14 +11,13 @@ 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'} }
options.merge!(lexer: language.downcase) if Pygments::Lexer.find(language)
h.content_tag :div, class: h.user_color_scheme_class do <<-HTML
if Pygments::Lexer.find(language) <div class="#{h.user_color_scheme_class}">
Pygments.highlight(code, options.merge(lexer: language.downcase)) #{Pygments.highlight(code, options)}
else </div>
Pygments.highlight(code, options) HTML
end.html_safe
end
end end
def postprocess(full_document) def postprocess(full_document)
......
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