diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-28 07:58:59 +0000 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-01-28 07:58:59 +0000 |
| commit | b6454591ccaeced4c57562167be903308102a25d (patch) | |
| tree | 3b3cfc57580f2a51cb7969b3a381b654df612d1a /lib | |
| parent | 55a662e0c94d19cc09bcec7a2701252cfa1e1450 (diff) | |
| parent | 891ea6f6e66c753d9a2f7a4e261f4d37e118c253 (diff) | |
| download | gitlab-ce-b6454591ccaeced4c57562167be903308102a25d.tar.gz | |
Merge branch 'highlight-js' into 'master'
Highlight.Js
Replace pygments code highlight with client-side library - highlight.js
http://highlightjs.org/
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/redcarpet/render/gitlab_html.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 2d1e0aec5e5..6da0c1d6f96 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -12,10 +12,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML end def block_code(code, language) - options = { options: {encoding: 'utf-8'} } - lexer = Pygments::Lexer.find(language) # language can be an alias - options.merge!(lexer: lexer.aliases[0].downcase) if lexer # downcase is required - # New lines are placed to fix an rendering issue # with code wrapped inside <h1> tag for next case: # @@ -25,7 +21,11 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML # <<-HTML - <div class="#{h.user_color_scheme_class}">#{Pygments.highlight(code, options)}</div> +<div class="highlighted-data #{h.user_color_scheme_class}"> + <div class="highlight"> + <pre><code class="#{language}">#{code}</code></pre> + </div> +</div> HTML end |
