commonmarker 0.17.2 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of commonmarker might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49c0fe604d16fddab739a15eb88155c8e8258554
4
- data.tar.gz: a6347c38e4659f38adea70964d62b6d31941f635
3
+ metadata.gz: 06be8d9079bbb1d192e313c782794782efac9f68
4
+ data.tar.gz: f503443bcbd7b8fbb92b0fe6f361b1ff14c2860e
5
5
  SHA512:
6
- metadata.gz: 5668901959312c78aabe85779d9d06ae9bafe500477122f02d851ed28a77588eb3eead6a83286db29161905aed6feb4f36f22ed8f797deb4dec8eaa68043a6cc
7
- data.tar.gz: 731052d3a802465eadd8473558d0a6a5b941252d74db531be6e9487f88ed7374e957170967f340e30916eb642fb322c5a11fa8fd03dc056f0b64e05302d497a5
6
+ metadata.gz: 9642157fb093681f693414574a933cbb7cf4ae365b16fde59a5b6949dedfa256455911d2735b5edaf62b1ac22eb105fa707415e36a4962025f1437612c7e9b10
7
+ data.tar.gz: d40fb12891798c9ce1841b885d12ec7424a047ef790a1290c7c2eac9498aaf5cb170df4c0b68a085b994b9314fd9f0e229579b1e88b4fee4d897aa138e2c55f6
@@ -19,7 +19,7 @@ set(PROJECT_NAME "cmark")
19
19
  set(PROJECT_VERSION_MAJOR 0)
20
20
  set(PROJECT_VERSION_MINOR 28)
21
21
  set(PROJECT_VERSION_PATCH 0)
22
- set(PROJECT_VERSION_GFM 10)
22
+ set(PROJECT_VERSION_GFM 11)
23
23
  set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM} )
24
24
 
25
25
  option(CMARK_TESTS "Build cmark tests and enable testing" ON)
@@ -1,3 +1,7 @@
1
+ [0.28.0.gfm.11]
2
+
3
+ * Do not output empty `<tbody>` in table extension.
4
+
1
5
  [0.28.0.gfm.10]
2
6
 
3
7
  * Fix denial of service parsing references.
@@ -319,7 +319,7 @@ static void postprocess_text(cmark_parser *parser, cmark_node *text, int offset)
319
319
 
320
320
  if (c == '@')
321
321
  nb++;
322
- else if (c == '.' && link_end < size - 1)
322
+ else if (c == '.' && link_end < size - 1 && cmark_isalnum(data[link_end + 1]))
323
323
  np++;
324
324
  else if (c != '-' && c != '_')
325
325
  break;
@@ -577,6 +577,10 @@ static void html_render(cmark_syntax_extension *extension,
577
577
  table_state->in_table_header = 1;
578
578
  cmark_strbuf_puts(html, "<thead>");
579
579
  cmark_html_render_cr(html);
580
+ } else if (!table_state->need_closing_table_body) {
581
+ cmark_strbuf_puts(html, "<tbody>");
582
+ cmark_html_render_cr(html);
583
+ table_state->need_closing_table_body = 1;
580
584
  }
581
585
  cmark_strbuf_puts(html, "<tr");
582
586
  cmark_html_render_sourcepos(node, html, options);
@@ -587,9 +591,6 @@ static void html_render(cmark_syntax_extension *extension,
587
591
  if (((node_table_row *)node->as.opaque)->is_header) {
588
592
  cmark_html_render_cr(html);
589
593
  cmark_strbuf_puts(html, "</thead>");
590
- cmark_html_render_cr(html);
591
- cmark_strbuf_puts(html, "<tbody>");
592
- table_state->need_closing_table_body = 1;
593
594
  table_state->in_table_header = false;
594
595
  }
595
596
  }
@@ -96,23 +96,20 @@ Here we demonstrate some edge cases about what is and isn't a table.
96
96
  <th>Just enough table</th>
97
97
  <th>to be considered table</th>
98
98
  </tr>
99
- </thead>
100
- <tbody></tbody></table>
99
+ </thead></table>
101
100
  <p>| ---- | --- |</p>
102
101
  <table>
103
102
  <thead>
104
103
  <tr>
105
104
  <th>x</th>
106
105
  </tr>
107
- </thead>
108
- <tbody></tbody></table>
106
+ </thead></table>
109
107
  <table>
110
108
  <thead>
111
109
  <tr>
112
110
  <th>xyz</th>
113
111
  </tr>
114
- </thead>
115
- <tbody></tbody></table>
112
+ </thead></table>
116
113
  ````````````````````````````````
117
114
 
118
115
  A "simpler" table, GFM style:
@@ -297,8 +294,7 @@ This shouldn't assert.
297
294
  <tr>
298
295
  <th>a</th>
299
296
  </tr>
300
- </thead>
301
- <tbody></tbody></table>
297
+ </thead></table>
302
298
  ````````````````````````````````
303
299
 
304
300
  ### Escaping
@@ -527,6 +523,19 @@ This shouldn't crash everything: (_A_@_.A
527
523
  <IGNORE>
528
524
  ````````````````````````````````
529
525
 
526
+ ```````````````````````````````` example
527
+ These should not link:
528
+
529
+ * @a.b.c@. x
530
+ * n@. b
531
+ .
532
+ <p>These should not link:</p>
533
+ <ul>
534
+ <li>@a.b.c@. x</li>
535
+ <li>n@. b</li>
536
+ </ul>
537
+ ````````````````````````````````
538
+
530
539
  ## HTML tag filter
531
540
 
532
541
 
@@ -3399,6 +3399,21 @@ cells are inserted. If there are greater, the excess is ignored:
3399
3399
  </tr></tbody></table>
3400
3400
  ````````````````````````````````
3401
3401
 
3402
+ If there are no rows in the body, no `<tbody>` is generated in HTML output:
3403
+
3404
+ ```````````````````````````````` example table
3405
+ | abc | def |
3406
+ | --- | --- |
3407
+ .
3408
+ <table>
3409
+ <thead>
3410
+ <tr>
3411
+ <th>abc</th>
3412
+ <th>def</th>
3413
+ </tr>
3414
+ </thead></table>
3415
+ ````````````````````````````````
3416
+
3402
3417
  </div>
3403
3418
 
3404
3419
  # Container blocks
@@ -161,19 +161,25 @@ module CommonMarker
161
161
 
162
162
  def table(node)
163
163
  @alignments = node.table_alignments
164
- out("<table#{sourcepos(node)}>\n", :children, "</tbody></table>\n")
164
+ out("<table#{sourcepos(node)}>\n", :children)
165
+ out("</tbody>") if @needs_close_tbody
166
+ out("</table>\n")
165
167
  end
166
168
 
167
169
  def table_header(node)
168
170
  @column_index = 0
169
171
 
170
172
  @in_header = true
171
- out("<thead>\n<tr#{sourcepos(node)}>", :children, "\n</tr>\n</thead>\n<tbody>")
173
+ out("<thead>\n<tr#{sourcepos(node)}>", :children, "\n</tr>\n</thead>")
172
174
  @in_header = false
173
175
  end
174
176
 
175
177
  def table_row(node)
176
178
  @column_index = 0
179
+ if !@in_header && !@needs_close_tbody
180
+ @needs_close_tbody = true
181
+ out("\n<tbody>")
182
+ end
177
183
  out("\n<tr#{sourcepos(node)}>", :children, "\n</tr>")
178
184
  end
179
185
 
@@ -1,3 +1,3 @@
1
1
  module CommonMarker
2
- VERSION = '0.17.2'.freeze
2
+ VERSION = '0.17.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-08 00:00:00.000000000 Z
12
+ date: 2017-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-enum