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.
- checksums.yaml +4 -4
- data/COPYING +0 -0
- data/README.markdown +10 -9
- data/Rakefile +4 -4
- data/ext/redcarpet/buffer.c +1 -1
- data/ext/redcarpet/buffer.h +1 -1
- data/ext/redcarpet/html.c +81 -25
- data/ext/redcarpet/html.h +7 -1
- data/ext/redcarpet/html_blocks.h +71 -48
- data/ext/redcarpet/markdown.c +14 -12
- data/ext/redcarpet/markdown.h +0 -3
- data/ext/redcarpet/rc_markdown.c +3 -7
- data/ext/redcarpet/rc_render.c +13 -8
- data/lib/redcarpet.rb +41 -74
- data/lib/redcarpet/compat.rb +70 -0
- data/lib/redcarpet/render_strip.rb +2 -2
- data/redcarpet.gemspec +7 -4
- data/test/benchmark.rb +24 -0
- data/test/html5_test.rb +69 -0
- data/test/html_render_test.rb +82 -73
- data/test/html_toc_render_test.rb +36 -9
- data/test/markdown_test.rb +26 -0
- data/test/safe_render_test.rb +36 -0
- data/test/stripdown_render_test.rb +25 -27
- data/test/test_helper.rb +23 -0
- metadata +11 -5
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.
|
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:
|
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.
|
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.
|
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.
|
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
|