devcenter-parser 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4a7ad15def36cd79744361bedc9ed41bac37f80
4
- data.tar.gz: 6e1b7a48971c56510f1ec690bd4d35ec32b03bfb
3
+ metadata.gz: c86b19b7db5df1fbf3ff75efcf6e8c5e820d4144
4
+ data.tar.gz: 005abc3e6957539c3c459748fae88dcc839338c0
5
5
  SHA512:
6
- metadata.gz: 588f10d24d89e888cb15b752ab78efa5faa1cd58ebd278108debb0200361beff8f1f8843c552e3de008c54079c2765052512631015aef20e89373527201e39ca
7
- data.tar.gz: 2089dda6802f629e4c6cfac1cba67e9944265475c14a4344caf2b072d434f9fb5ed096359c78ab1416f46d59c739ad495b8331c33e9ecdcfb9e5a7c5b73da935
6
+ metadata.gz: be7ebb71b4c901ed408ca12a52772abfd4ea2dbd12cf4ba24d8f57c0e4198e04e2685c9e2f484dc06c44ba12a4047d089cf1b7ef9f418cfd27d5cecfa9c3ccea
7
+ data.tar.gz: e3440ec9fcd6918dec57d4e16942a4d1ed98a871699ecc1afbe2f027b26f3593f38b30357ca31b496bf399556468639831e1d7ae7f246a92ac4538960adb15df
@@ -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.6.1'
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'
@@ -6,8 +6,6 @@ require 'sanitize'
6
6
 
7
7
  module DevcenterParser
8
8
 
9
- VERSION = '1.3.7'
10
-
11
9
  AVAILABLE_FLAVOURS = [:github, :maruku]
12
10
 
13
11
  class InvalidMarkdownError < Exception; end
@@ -1,3 +1,3 @@
1
1
  module DevcenterParser
2
- VERSION = '1.3.8'
2
+ VERSION = '1.3.9'
3
3
  end
@@ -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, md
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
- assert_maruku_result md, '<strong id="foo">clean</strong>'
39
- assert_github_result md, '<p><strong id="foo">clean</strong></p>'
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
- assert_maruku_result md, '<strong>clean</strong>'
45
- assert_github_result md, '<p><strong>clean</strong></p>'
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
- :::ruby
96
- puts 'hi'
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="ruby">puts 'hi'</code></pre>
110
+ <pre><code class="term">$ command
111
+
112
+ indented
113
+ &lt; tag1
114
+ &gt; 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
- ```ruby
114
- puts 'hi'
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="ruby">puts 'hi'
137
+ <pre><code class="term">$ command
138
+
139
+ indented
140
+ &lt; tag1
141
+ &gt; 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
- assert_maruku_result md, md
349
- assert_github_result md, "<p>#{md}</p>"
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.8
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.6.1
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.6.1
26
+ version: 0.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement