Fixed wierd gitlab markdown issue

This commit is contained in:
Dmitriy Zaporozhets 2012-12-22 14:18:40 +02:00
parent cec866a7ce
commit 2398af9ab0
2 changed files with 12 additions and 5 deletions

View file

@ -13,10 +13,17 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
options = { options: {encoding: 'utf-8'} }
options.merge!(lexer: language.downcase) if Pygments::Lexer.find(language)
# New lines are placed to fix an rendering issue
# with code wrapped inside <h1> tag for next case:
#
# # Title kinda h1
#
# ruby code here
#
<<-HTML
<div class="#{h.user_color_scheme_class}">
#{Pygments.highlight(code, options)}
</div>
<div class="#{h.user_color_scheme_class}">#{Pygments.highlight(code, options)}</div>
HTML
end