Skip to content

Commit 17362ac

Browse files
committed
升级 Rouge.
1 parent 4a57d78 commit 17362ac

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ matrix:
1010
- rvm: ruby-head
1111

1212
rvm:
13-
- 1.9.3
1413
- 2.0.0
14+
- 2.1.0
1515

1616
before_script:
1717
- mongo ruby_china_test --eval 'db.addUser("travis", "test");'

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ gem "redis-objects", "0.5.2"
5252

5353
# Markdown 格式 & 文本处理
5454
gem "redcarpet", "~> 2.2.2"
55-
gem "rouge", "~> 0.3.10"
55+
gem "rouge", "~> 1.0.0"
5656
gem 'nokogiri', "~> 1.5.6"
5757
gem 'auto-space', '0.0.2'
5858

Gemfile.lock

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ GEM
297297
remotipart (1.0.5)
298298
rest-client (1.6.7)
299299
mime-types (>= 1.16)
300-
rouge (0.3.10)
301-
thor
300+
rouge (1.0.0)
302301
rspec (2.13.0)
303302
rspec-core (~> 2.13.0)
304303
rspec-expectations (~> 2.13.0)
@@ -437,7 +436,7 @@ DEPENDENCIES
437436
redcarpet (~> 2.2.2)
438437
redis-namespace (~> 1.2.1)
439438
redis-objects (= 0.5.2)
440-
rouge (~> 0.3.10)
439+
rouge (~> 1.0.0)
441440
rspec-cells (= 0.1.7)
442441
rspec-rails (~> 2.13.2)
443442
rvm-capistrano

spec/helpers/topics_helper_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,30 +107,30 @@
107107

108108
it "should highlight code block" do
109109
helper.format_topic_body("```ruby\nclass Hello\n\nend\n```").should ==
110-
%(<pre class=\"highlight ruby\"><span class=\"k\">class </span><span class=\"nc\">Hello</span>\n\n<span class=\"k\">end</span>\n</pre>)
110+
%(<pre class=\"highlight ruby\"><span class=\"k\">class</span> <span class=\"nc\">Hello</span>\n\n<span class=\"k\">end</span>\n</pre>)
111111
end
112112

113113
it "should be able to identigy Ruby or RUBY as ruby language" do
114114
['Ruby', 'RUBY'].each do |lang|
115115
helper.format_topic_body("```#{lang}\nclass Hello\nend\n```").should ==
116-
%(<pre class=\"highlight ruby\"><span class=\"k\">class </span><span class=\"nc\">Hello</span>\n<span class=\"k\">end</span>\n</pre>)
116+
%(<pre class=\"highlight ruby\"><span class=\"k\">class</span> <span class=\"nc\">Hello</span>\n<span class=\"k\">end</span>\n</pre>)
117117
end
118118
end
119119

120120
it "should highlight code block after the content" do
121121
helper.format_topic_body("this code:\n```\ngem install rails\n```\n").should ==
122-
%(<p>this code:</p>\n<pre class=\"highlight text\">gem install rails\n</pre>)
122+
%(<p>this code:</p>\n<pre class=\"highlight plaintext\">gem install rails\n</pre>)
123123
end
124124

125125
it "should highlight code block without language" do
126126
helper.format_topic_body("```\ngem install ruby\n```").gsub("\n",'').should ==
127-
%(<pre class=\"highlight text\">gem install ruby</pre>)
127+
%(<pre class=\"highlight plaintext\">gem install ruby</pre>)
128128
end
129129

130130
it "should not filter underscore" do
131131
helper.format_topic_body("ruby_china_image `ruby_china_image`").should == "<p>ruby_china_image <code>ruby_china_image</code></p>"
132132
helper.format_topic_body("```\nruby_china_image\n```").should ==
133-
%(<pre class=\"highlight text\">ruby_china_image\n</pre>)
133+
%(<pre class=\"highlight plaintext\">ruby_china_image\n</pre>)
134134
end
135135
end
136136

0 commit comments

Comments
 (0)