summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-22 13:01:15 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-22 13:01:15 +0200
commitcec866a7cee86a0f56a5c1f0b11d2c19b61947e8 (patch)
tree9a6fd9641f040c1bc970401f4be5d6ea2624199f
parented35ea703cc4430c4c30f58d1183607ccc625bf8 (diff)
downloadgitlab-ce-cec866a7cee86a0f56a5c1f0b11d2c19b61947e8.tar.gz
Improve wiki rendering. Fix pygemnt + markdown invalid html
-rw-r--r--app/assets/stylesheets/gitlab_bootstrap/files.scss14
-rw-r--r--lib/redcarpet/render/gitlab_html.rb13
2 files changed, 15 insertions, 12 deletions
diff --git a/app/assets/stylesheets/gitlab_bootstrap/files.scss b/app/assets/stylesheets/gitlab_bootstrap/files.scss
index e4924a49456..83954da525a 100644
--- a/app/assets/stylesheets/gitlab_bootstrap/files.scss
+++ b/app/assets/stylesheets/gitlab_bootstrap/files.scss
@@ -43,11 +43,15 @@
padding: 0 4px;
}
padding: 20px;
- h1, h2 {
- line-height: 46px;
- }
- h3, h4 {
- line-height: 40px;
+
+ h1 { font-size: 26px; line-height: 46px; }
+ h2 { font-size: 22px; line-height: 42px; }
+ h3 { font-size: 20px; line-height: 40px; }
+ h4 { font-size: 18px; line-height: 32px; }
+ h5 { font-size: 16px; line-height: 26px; }
+
+ .white .highlight pre {
+ background: #f5f5f5;
}
}
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index bd590f92734..3c5ca1ce9da 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -11,14 +11,13 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def block_code(code, language)
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
- if Pygments::Lexer.find(language)
- Pygments.highlight(code, options.merge(lexer: language.downcase))
- else
- Pygments.highlight(code, options)
- end.html_safe
- end
+ <<-HTML
+ <div class="#{h.user_color_scheme_class}">
+ #{Pygments.highlight(code, options)}
+ </div>
+ HTML
end
def postprocess(full_document)