tight-redcarpet 3.1.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_helper.rb CHANGED
@@ -15,4 +15,27 @@ class Redcarpet::TestCase < Test::Unit::TestCase
15
15
  assert_equal Nokogiri::HTML::DocumentFragment.parse(html_a).to_html,
16
16
  Nokogiri::HTML::DocumentFragment.parse(html_b).to_html
17
17
  end
18
+
19
+ def assert_renders(html, markdown)
20
+ html_equal html, render(markdown)
21
+ end
22
+
23
+ def render(markdown, options = {})
24
+ options = options.fetch(:with, {})
25
+
26
+ if options.kind_of?(Array)
27
+ options = Hash[options.map {|o| [o, true]}]
28
+ end
29
+
30
+ render = renderer.new(options)
31
+ parser = Redcarpet::Markdown.new(render, options)
32
+
33
+ parser.render(markdown)
34
+ end
35
+
36
+ private
37
+
38
+ def renderer
39
+ @renderer ||= Redcarpet::Render::HTML
40
+ end
18
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tight-redcarpet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natacha Porté
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-07-04 00:00:00.000000000 Z
13
+ date: 2015-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 1.6.0
21
+ version: 1.6.3.1
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 1.6.0
28
+ version: 1.6.3.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake-compiler
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -93,12 +93,15 @@ files:
93
93
  - lib/redcarpet/render_man.rb
94
94
  - lib/redcarpet/render_strip.rb
95
95
  - redcarpet.gemspec
96
+ - test/benchmark.rb
96
97
  - test/custom_render_test.rb
98
+ - test/html5_test.rb
97
99
  - test/html_render_test.rb
98
100
  - test/html_toc_render_test.rb
99
101
  - test/markdown_test.rb
100
102
  - test/pathological_inputs_test.rb
101
103
  - test/redcarpet_compat_test.rb
104
+ - test/safe_render_test.rb
102
105
  - test/smarty_html_test.rb
103
106
  - test/smarty_pants_test.rb
104
107
  - test/stripdown_render_test.rb
@@ -123,17 +126,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
126
  version: '0'
124
127
  requirements: []
125
128
  rubyforge_project:
126
- rubygems_version: 2.2.2
129
+ rubygems_version: 2.4.2
127
130
  signing_key:
128
131
  specification_version: 4
129
132
  summary: Markdown that smells nice (patch level 'tight')
130
133
  test_files:
134
+ - test/benchmark.rb
131
135
  - test/custom_render_test.rb
136
+ - test/html5_test.rb
132
137
  - test/html_render_test.rb
133
138
  - test/html_toc_render_test.rb
134
139
  - test/markdown_test.rb
135
140
  - test/pathological_inputs_test.rb
136
141
  - test/redcarpet_compat_test.rb
142
+ - test/safe_render_test.rb
137
143
  - test/smarty_html_test.rb
138
144
  - test/smarty_pants_test.rb
139
145
  - test/stripdown_render_test.rb