[#19] restore codemirror highlight for comments code
This commit is contained in:
parent
3725467aa3
commit
7d7df64611
4
Gemfile
4
Gemfile
|
@ -28,6 +28,7 @@ gem 'diff-display', '~> 0.0.1'
|
|||
|
||||
# Wiki
|
||||
gem "gollum", '~> 2.1.3'
|
||||
gem "redcarpet", '~> 2.2.2'
|
||||
gem 'creole'
|
||||
gem 'rdiscount'
|
||||
# gem 'org-ruby'
|
||||
|
@ -53,9 +54,6 @@ gem 'rest-client', '~> 1.6.6'
|
|||
|
||||
gem 'attr_encrypted', '1.2.1'
|
||||
|
||||
gem "gitlab-pygments.rb", '~> 0.3.2', require: 'pygments.rb'
|
||||
gem "redcarpet", "~> 2.2.2"
|
||||
|
||||
group :assets do
|
||||
gem 'sass-rails', '~> 3.2.5'
|
||||
gem 'coffee-rails', '~> 3.2.2'
|
||||
|
|
|
@ -129,9 +129,6 @@ GEM
|
|||
pygments.rb (>= 0.2.13)
|
||||
github-markdown (0.5.3)
|
||||
github-markup (0.7.5)
|
||||
gitlab-pygments.rb (0.3.2)
|
||||
posix-spawn (~> 0.3.6)
|
||||
yajl-ruby (~> 1.1.0)
|
||||
gollum (2.1.10)
|
||||
github-markdown
|
||||
github-markup (>= 0.7.0, < 1.0.0)
|
||||
|
@ -374,7 +371,6 @@ GEM
|
|||
builder
|
||||
expression_parser
|
||||
will_paginate (3.0.4)
|
||||
yajl-ruby (1.1.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
@ -398,7 +394,6 @@ DEPENDENCIES
|
|||
factory_girl_rails (~> 4.0.0)
|
||||
gemoji (~> 1.2.1)
|
||||
github-linguist (~> 2.3.4)
|
||||
gitlab-pygments.rb (~> 0.3.2)
|
||||
gollum (~> 2.1.3)
|
||||
grack!
|
||||
grit!
|
||||
|
|
|
@ -4,4 +4,3 @@
|
|||
@import "design/common";
|
||||
@import "design/custom";
|
||||
@import "design/build_lists_monitoring";
|
||||
@import "design/pygments-github";
|
|
@ -1,63 +0,0 @@
|
|||
/* https://github.com/richleland/pygments-css */
|
||||
|
||||
.hll { background-color: #ffffcc }
|
||||
.c { color: #999988; font-style: italic } /* Comment */
|
||||
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
||||
.k { color: #000000; font-weight: bold } /* Keyword */
|
||||
.o { color: #000000; font-weight: bold } /* Operator */
|
||||
.cm { color: #999988; font-style: italic } /* Comment.Multiline */
|
||||
.cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
|
||||
.c1 { color: #999988; font-style: italic } /* Comment.Single */
|
||||
.cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
|
||||
.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
|
||||
.ge { color: #000000; font-style: italic } /* Generic.Emph */
|
||||
.gr { color: #aa0000 } /* Generic.Error */
|
||||
.gh { color: #999999 } /* Generic.Heading */
|
||||
.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
|
||||
.go { color: #888888 } /* Generic.Output */
|
||||
.gp { color: #555555 } /* Generic.Prompt */
|
||||
.gs { font-weight: bold } /* Generic.Strong */
|
||||
.gu { color: #aaaaaa } /* Generic.Subheading */
|
||||
.gt { color: #aa0000 } /* Generic.Traceback */
|
||||
.kc { color: #000000; font-weight: bold } /* Keyword.Constant */
|
||||
.kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
|
||||
.kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
|
||||
.kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
|
||||
.kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
|
||||
.kt { color: #445588; font-weight: bold } /* Keyword.Type */
|
||||
.m { color: #009999 } /* Literal.Number */
|
||||
.s { color: #d01040 } /* Literal.String */
|
||||
.na { color: #008080 } /* Name.Attribute */
|
||||
.nb { color: #0086B3 } /* Name.Builtin */
|
||||
.nc { color: #445588; font-weight: bold } /* Name.Class */
|
||||
.no { color: #008080 } /* Name.Constant */
|
||||
.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
|
||||
.ni { color: #800080 } /* Name.Entity */
|
||||
.ne { color: #990000; font-weight: bold } /* Name.Exception */
|
||||
.nf { color: #990000; font-weight: bold } /* Name.Function */
|
||||
.nl { color: #990000; font-weight: bold } /* Name.Label */
|
||||
.nn { color: #555555 } /* Name.Namespace */
|
||||
.nt { color: #000080 } /* Name.Tag */
|
||||
.nv { color: #008080 } /* Name.Variable */
|
||||
.ow { color: #000000; font-weight: bold } /* Operator.Word */
|
||||
.w { color: #bbbbbb } /* Text.Whitespace */
|
||||
.mf { color: #009999 } /* Literal.Number.Float */
|
||||
.mh { color: #009999 } /* Literal.Number.Hex */
|
||||
.mi { color: #009999 } /* Literal.Number.Integer */
|
||||
.mo { color: #009999 } /* Literal.Number.Oct */
|
||||
.sb { color: #d01040 } /* Literal.String.Backtick */
|
||||
.sc { color: #d01040 } /* Literal.String.Char */
|
||||
.sd { color: #d01040 } /* Literal.String.Doc */
|
||||
.s2 { color: #d01040 } /* Literal.String.Double */
|
||||
.se { color: #d01040 } /* Literal.String.Escape */
|
||||
.sh { color: #d01040 } /* Literal.String.Heredoc */
|
||||
.si { color: #d01040 } /* Literal.String.Interpol */
|
||||
.sx { color: #d01040 } /* Literal.String.Other */
|
||||
.sr { color: #009926 } /* Literal.String.Regex */
|
||||
.s1 { color: #d01040 } /* Literal.String.Single */
|
||||
.ss { color: #990073 } /* Literal.String.Symbol */
|
||||
.bp { color: #999999 } /* Name.Builtin.Pseudo */
|
||||
.vc { color: #008080 } /* Name.Variable.Class */
|
||||
.vg { color: #008080 } /* Name.Variable.Global */
|
||||
.vi { color: #008080 } /* Name.Variable.Instance */
|
||||
.il { color: #009999 } /* Literal.Number.Integer.Long */
|
|
@ -12,9 +12,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
|
|||
end
|
||||
|
||||
def block_code(code, language)
|
||||
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:
|
||||
#
|
||||
|
@ -24,7 +21,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
|
|||
#
|
||||
<<-HTML
|
||||
|
||||
<div>#{Pygments.highlight(code, options)}</div>
|
||||
<pre><code class="#{language.downcase}">#{code}</code></pre>
|
||||
|
||||
HTML
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue