greenmat 3.2.2.3 → 3.2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/ext/greenmat/gm_markdown.c +3 -1
- data/lib/greenmat/version.rb +1 -1
- data/spec/greenmat/markdown_spec.rb +101 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 76edffbbbd17aad1bb2dca2fe858ae3de4dac30ec712f923a9a5f4da23e910c8
|
4
|
+
data.tar.gz: 71f03be1b989cec97a7453db1a7cb4eaba97b1be3857e52f178c8191d9f1d4c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aecd348a33adfbe06bfe6033eeae1f2b0852172cff4b11536e22acd87386861d079df3afe487c3d3dfbe8a42902ffd9f42c9fa84783a0be213ef274922236ed5
|
7
|
+
data.tar.gz: 6e6bea252d5660ede666d0030811780b8937b1ca6465569b0b93edb5b70322c4376f148b190dab68fabe23a0569a9fcf612ad648e4f61fdef55a6d8cd913ecf7
|
data/CHANGELOG.md
CHANGED
data/ext/greenmat/gm_markdown.c
CHANGED
@@ -20,6 +20,8 @@ VALUE rb_cMarkdown;
|
|
20
20
|
|
21
21
|
extern VALUE rb_cRenderBase;
|
22
22
|
|
23
|
+
static size_t MAX_NESTING = 32;
|
24
|
+
|
23
25
|
static void rb_greenmat_md_flags(VALUE hash, unsigned int *enabled_extensions_p)
|
24
26
|
{
|
25
27
|
unsigned int extensions = 0;
|
@@ -99,7 +101,7 @@ static VALUE rb_greenmat_md__new(int argc, VALUE *argv, VALUE klass)
|
|
99
101
|
|
100
102
|
Data_Get_Struct(rb_rndr, struct rb_greenmat_rndr, rndr);
|
101
103
|
|
102
|
-
markdown = sd_markdown_new(extensions,
|
104
|
+
markdown = sd_markdown_new(extensions, MAX_NESTING, &rndr->callbacks, &rndr->options);
|
103
105
|
if (!markdown)
|
104
106
|
rb_raise(rb_eRuntimeError, "Failed to create new Renderer class");
|
105
107
|
|
data/lib/greenmat/version.rb
CHANGED
@@ -83,5 +83,106 @@ module Greenmat
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
context 'with deeply nested list' do
|
88
|
+
let(:text) do
|
89
|
+
<<-EOS.strip_heredoc
|
90
|
+
* 1
|
91
|
+
* 2
|
92
|
+
* 3
|
93
|
+
* 4
|
94
|
+
* 5
|
95
|
+
* 6
|
96
|
+
* 7
|
97
|
+
* 8
|
98
|
+
* 9
|
99
|
+
* 10
|
100
|
+
* 11
|
101
|
+
EOS
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'renders the list up to 10 nesting and then gives up' do
|
105
|
+
expect(rendered_html).to eq <<-EOS.strip_heredoc
|
106
|
+
<ul>
|
107
|
+
<li>1
|
108
|
+
|
109
|
+
<ul>
|
110
|
+
<li>2
|
111
|
+
|
112
|
+
<ul>
|
113
|
+
<li>3
|
114
|
+
|
115
|
+
<ul>
|
116
|
+
<li>4
|
117
|
+
|
118
|
+
<ul>
|
119
|
+
<li>5
|
120
|
+
|
121
|
+
<ul>
|
122
|
+
<li>6
|
123
|
+
|
124
|
+
<ul>
|
125
|
+
<li>7
|
126
|
+
|
127
|
+
<ul>
|
128
|
+
<li>8
|
129
|
+
|
130
|
+
<ul>
|
131
|
+
<li>9
|
132
|
+
|
133
|
+
<ul>
|
134
|
+
<li>10
|
135
|
+
|
136
|
+
<ul>
|
137
|
+
<li></li>
|
138
|
+
</ul></li>
|
139
|
+
</ul></li>
|
140
|
+
</ul></li>
|
141
|
+
</ul></li>
|
142
|
+
</ul></li>
|
143
|
+
</ul></li>
|
144
|
+
</ul></li>
|
145
|
+
</ul></li>
|
146
|
+
</ul></li>
|
147
|
+
</ul></li>
|
148
|
+
</ul>
|
149
|
+
EOS
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
context 'with a deeply nested structure that can exist in the wild' do
|
154
|
+
let(:text) do
|
155
|
+
<<-EOS.strip_heredoc
|
156
|
+
> > * 1
|
157
|
+
> > * 2
|
158
|
+
> > * 3
|
159
|
+
> > * [_**Qiita**_](https://qiita.com)
|
160
|
+
EOS
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'renders it properly' do
|
164
|
+
expect(rendered_html).to eq <<-EOS.strip_heredoc
|
165
|
+
<blockquote>
|
166
|
+
<blockquote>
|
167
|
+
<ul>
|
168
|
+
<li>1
|
169
|
+
|
170
|
+
<ul>
|
171
|
+
<li>2
|
172
|
+
|
173
|
+
<ul>
|
174
|
+
<li>3
|
175
|
+
|
176
|
+
<ul>
|
177
|
+
<li><a href="https://qiita.com"><em><strong>Qiita</strong></em></a></li>
|
178
|
+
</ul></li>
|
179
|
+
</ul></li>
|
180
|
+
</ul></li>
|
181
|
+
</ul>
|
182
|
+
</blockquote>
|
183
|
+
</blockquote>
|
184
|
+
EOS
|
185
|
+
end
|
186
|
+
end
|
86
187
|
end
|
87
188
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greenmat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.2.
|
4
|
+
version: 3.2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natacha Porté
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-06-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
262
|
rubyforge_project:
|
263
|
-
rubygems_version: 2.
|
263
|
+
rubygems_version: 2.7.4
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: A Markdown parser for Qiita, based on Redcarpet.
|