devcenter-parser 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/devcenter-parser.gemspec +1 -1
- data/lib/devcenter-parser.rb +0 -2
- data/lib/devcenter-parser/version.rb +1 -1
- data/test/devcenter-parser_test.rb +33 -14
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86b19b7db5df1fbf3ff75efcf6e8c5e820d4144
|
4
|
+
data.tar.gz: 005abc3e6957539c3c459748fae88dcc839338c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be7ebb71b4c901ed408ca12a52772abfd4ea2dbd12cf4ba24d8f57c0e4198e04e2685c9e2f484dc06c44ba12a4047d089cf1b7ef9f418cfd27d5cecfa9c3ccea
|
7
|
+
data.tar.gz: e3440ec9fcd6918dec57d4e16942a4d1ed98a871699ecc1afbe2f027b26f3593f38b30357ca31b496bf399556468639831e1d7ae7f246a92ac4538960adb15df
|
data/devcenter-parser.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
15
|
gem.require_paths = %w{ lib }
|
16
16
|
|
17
|
-
gem.add_runtime_dependency 'maruku', '0.
|
17
|
+
gem.add_runtime_dependency 'maruku', '0.7.0'
|
18
18
|
gem.add_runtime_dependency 'nokogiri', '>= 1.4.4'
|
19
19
|
gem.add_runtime_dependency 'redcarpet', '3.0.0'
|
20
20
|
gem.add_runtime_dependency 'sanitize', '2.0.6'
|
data/lib/devcenter-parser.rb
CHANGED
@@ -13,7 +13,7 @@ describe 'DevcenterParser' do
|
|
13
13
|
|
14
14
|
it 'maintains script tags' do
|
15
15
|
md = '<script>alert("hi")</script>'
|
16
|
-
assert_parsing_unsanitized_result md, :maruku,
|
16
|
+
assert_parsing_unsanitized_result md, :maruku, '<script><![CDATA[alert("hi")]]></script>'
|
17
17
|
assert_parsing_unsanitized_result md, :github, '<script>alert("hi")</script>'
|
18
18
|
end
|
19
19
|
|
@@ -35,14 +35,16 @@ describe 'DevcenterParser' do
|
|
35
35
|
|
36
36
|
it 'respects existing ids' do
|
37
37
|
md = '<strong id="foo">clean</strong>'
|
38
|
-
|
39
|
-
|
38
|
+
html = '<p><strong id="foo">clean</strong></p>'
|
39
|
+
assert_maruku_result md, html
|
40
|
+
assert_github_result md, html
|
40
41
|
end
|
41
42
|
|
42
43
|
it 'removes script tags and their content' do
|
43
44
|
md = '<strong>clean<script>alert("hack!")</script></strong>'
|
44
|
-
|
45
|
-
|
45
|
+
html = '<p><strong>clean</strong></p>'
|
46
|
+
assert_maruku_result md, html
|
47
|
+
assert_github_result md, html
|
46
48
|
end
|
47
49
|
|
48
50
|
it 'includes ids in subheaders' do
|
@@ -88,12 +90,16 @@ HTML
|
|
88
90
|
assert_github_result(md, html)
|
89
91
|
end
|
90
92
|
|
91
|
-
it 'supports code blocks, adding a custom class attribute' do
|
93
|
+
it 'supports code blocks, respecting indentation and adding a custom class attribute' do
|
92
94
|
md = <<-MARKDOWN
|
93
95
|
Paragraph
|
94
96
|
|
95
|
-
:::
|
96
|
-
|
97
|
+
:::term
|
98
|
+
$ command
|
99
|
+
|
100
|
+
indented
|
101
|
+
< tag1
|
102
|
+
> tag2
|
97
103
|
|
98
104
|
Another paragraph
|
99
105
|
MARKDOWN
|
@@ -101,7 +107,11 @@ MARKDOWN
|
|
101
107
|
html = <<-HTML
|
102
108
|
<p>Paragraph</p>
|
103
109
|
|
104
|
-
<pre><code class="
|
110
|
+
<pre><code class="term">$ command
|
111
|
+
|
112
|
+
indented
|
113
|
+
< tag1
|
114
|
+
> tag2</code></pre>
|
105
115
|
|
106
116
|
<p>Another paragraph</p>
|
107
117
|
HTML
|
@@ -110,8 +120,12 @@ HTML
|
|
110
120
|
md = <<-MARKDOWN
|
111
121
|
Paragraph
|
112
122
|
|
113
|
-
```
|
114
|
-
|
123
|
+
```term
|
124
|
+
$ command
|
125
|
+
|
126
|
+
indented
|
127
|
+
< tag1
|
128
|
+
> tag2
|
115
129
|
```
|
116
130
|
|
117
131
|
Another paragraph
|
@@ -120,7 +134,11 @@ MARKDOWN
|
|
120
134
|
html = <<-HTML
|
121
135
|
<p>Paragraph</p>
|
122
136
|
|
123
|
-
<pre><code class="
|
137
|
+
<pre><code class="term">$ command
|
138
|
+
|
139
|
+
indented
|
140
|
+
< tag1
|
141
|
+
> tag2
|
124
142
|
</code></pre>
|
125
143
|
|
126
144
|
<p>Another paragraph</p>
|
@@ -345,8 +363,9 @@ more callout</p>
|
|
345
363
|
|
346
364
|
it 'does not add href attribute to links where it does not exist' do
|
347
365
|
md = '<a name="heh"></a>'
|
348
|
-
|
349
|
-
|
366
|
+
html = '<p><a name="heh"></a></p>'
|
367
|
+
assert_maruku_result md, html
|
368
|
+
assert_github_result md, html
|
350
369
|
end
|
351
370
|
|
352
371
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devcenter-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heroku
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|