devcenter-parser 1.3.1 → 1.3.2
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 +7 -0
- data/lib/devcenter-parser.rb +7 -2
- data/test/devcenter-parser_test.rb +24 -4
- metadata +5 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: c4625d0620bfb6d0da568af275972249776bc60e
|
4
|
+
data.tar.gz: 12e3576026957882728a1c14b335864cb570592a
|
5
|
+
!binary "U0hBNTEy":
|
6
|
+
metadata.gz: 91498d9bb224e4a1c66ba3fc983e0ad620e33d71b8cfec7a5273e9a1d5ebede093f05d46e40c6e941b72c445c903cf7cd4ea02a59c00f37c765468299c81606a
|
7
|
+
data.tar.gz: b2899c194bd68b0c556768a97675b6c0c35019bb7875bed2a04e5dac628c9d8ead99ac658f4da18f784b92846bbc385a6ccf85bb0549eee507689f94f82228e4
|
data/lib/devcenter-parser.rb
CHANGED
@@ -6,7 +6,7 @@ require 'sanitize'
|
|
6
6
|
|
7
7
|
module DevcenterParser
|
8
8
|
|
9
|
-
VERSION = '1.3.
|
9
|
+
VERSION = '1.3.2'
|
10
10
|
|
11
11
|
AVAILABLE_FLAVOURS = [:github, :maruku]
|
12
12
|
|
@@ -111,7 +111,12 @@ module DevcenterParser
|
|
111
111
|
if match = node.inner_html.match(/\A\W*(callout|warning|note)\W/)
|
112
112
|
node.parent.name = 'div'
|
113
113
|
node.parent['class'] = match[1]
|
114
|
-
|
114
|
+
|
115
|
+
new_html = node.inner_html.gsub(/\A\W*(callout|warning|note)\W/, '')
|
116
|
+
|
117
|
+
# Assigning inner_html directly causes encoding issues in old libxml versions,
|
118
|
+
# workaround from https://github.com/sparklemotion/nokogiri/issues/458#issuecomment-3136620
|
119
|
+
node.children = Nokogiri::HTML.fragment(new_html, 'utf-8')
|
115
120
|
end
|
116
121
|
end
|
117
122
|
end
|
@@ -56,6 +56,26 @@ MARKDOWN
|
|
56
56
|
end
|
57
57
|
|
58
58
|
describe 'github markdown' do
|
59
|
+
|
60
|
+
it 'generates apostrophes from single quotes in plain text' do
|
61
|
+
md = "That's it"
|
62
|
+
html = "<p>That’s it</p>"
|
63
|
+
assert_github_result(md, html)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'generates apostrophes from single quotes in callout|warning|note blocks' do
|
67
|
+
md = <<-MARKDOWN
|
68
|
+
> warning
|
69
|
+
> That's it
|
70
|
+
MARKDOWN
|
71
|
+
html = <<-HTML
|
72
|
+
<div class="warning">
|
73
|
+
<p>That’s it</p>
|
74
|
+
</div>
|
75
|
+
HTML
|
76
|
+
assert_github_result(md, html)
|
77
|
+
end
|
78
|
+
|
59
79
|
it 'github markdown supports regular block quotes without callout|warning|note' do
|
60
80
|
md = <<-MARKDOWN
|
61
81
|
Testing
|
@@ -76,7 +96,7 @@ And that's it.
|
|
76
96
|
normal</p>
|
77
97
|
</blockquote>
|
78
98
|
|
79
|
-
<p>And that
|
99
|
+
<p>And that’s it.</p>
|
80
100
|
HTML
|
81
101
|
|
82
102
|
assert_github_result(md, html)
|
@@ -100,7 +120,7 @@ And that's it.
|
|
100
120
|
normal</p>
|
101
121
|
</blockquote>
|
102
122
|
|
103
|
-
<p>And that
|
123
|
+
<p>And that’s it.</p>
|
104
124
|
HTML
|
105
125
|
|
106
126
|
assert_github_result(md, html)
|
@@ -136,7 +156,7 @@ And that's it.
|
|
136
156
|
normal</p>
|
137
157
|
</div>
|
138
158
|
|
139
|
-
<p>And that
|
159
|
+
<p>And that’s it.</p>
|
140
160
|
HTML
|
141
161
|
|
142
162
|
mds.each do |md|
|
@@ -177,7 +197,7 @@ And that's it.
|
|
177
197
|
<p>normal</p>
|
178
198
|
</div>
|
179
199
|
|
180
|
-
<p>And that
|
200
|
+
<p>And that’s it.</p>
|
181
201
|
HTML
|
182
202
|
|
183
203
|
mds.each do |md|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devcenter-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Heroku
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: maruku
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: nokogiri
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: redcarpet
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: sanitize
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: minitest
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ! '>'
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ! '>'
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -106,28 +95,26 @@ files:
|
|
106
95
|
- test/devcenter-parser_test.rb
|
107
96
|
homepage: https://devcenter.heroku.com
|
108
97
|
licenses: []
|
98
|
+
metadata: {}
|
109
99
|
post_install_message:
|
110
100
|
rdoc_options: []
|
111
101
|
require_paths:
|
112
102
|
- lib
|
113
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
104
|
requirements:
|
116
105
|
- - ! '>='
|
117
106
|
- !ruby/object:Gem::Version
|
118
107
|
version: '0'
|
119
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
-
none: false
|
121
109
|
requirements:
|
122
110
|
- - ! '>='
|
123
111
|
- !ruby/object:Gem::Version
|
124
112
|
version: '0'
|
125
113
|
requirements: []
|
126
114
|
rubyforge_project:
|
127
|
-
rubygems_version:
|
115
|
+
rubygems_version: 2.0.0
|
128
116
|
signing_key:
|
129
|
-
specification_version:
|
117
|
+
specification_version: 4
|
130
118
|
summary: Parser for Heroku Dev Center's content
|
131
119
|
test_files:
|
132
120
|
- test/devcenter-parser_test.rb
|
133
|
-
has_rdoc:
|