commonmarker 0.17.11 → 0.17.12

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.

Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/ext/commonmarker/arena.c +2 -2
  3. data/ext/commonmarker/autolink.h +3 -3
  4. data/ext/commonmarker/blocks.c +1 -1
  5. data/ext/commonmarker/buffer.h +23 -23
  6. data/ext/commonmarker/chunk.h +1 -1
  7. data/ext/commonmarker/cmark-gfm-core-extensions.h +25 -0
  8. data/ext/commonmarker/{cmark_extension_api.h → cmark-gfm-extension_api.h} +67 -67
  9. data/ext/commonmarker/cmark-gfm-extensions_export.h +42 -0
  10. data/ext/commonmarker/{cmark.h → cmark-gfm.h} +88 -88
  11. data/ext/commonmarker/cmark-gfm_export.h +42 -0
  12. data/ext/commonmarker/cmark-gfm_version.h +7 -0
  13. data/ext/commonmarker/cmark.c +3 -3
  14. data/ext/commonmarker/cmark_ctype.h +6 -6
  15. data/ext/commonmarker/commonmark.c +2 -2
  16. data/ext/commonmarker/commonmarker.c +5 -5
  17. data/ext/commonmarker/commonmarker.h +1 -1
  18. data/ext/commonmarker/core-extensions.c +2 -2
  19. data/ext/commonmarker/ext_scanners.h +1 -1
  20. data/ext/commonmarker/footnotes.c +1 -1
  21. data/ext/commonmarker/houdini.h +6 -6
  22. data/ext/commonmarker/houdini_href_e.c +2 -2
  23. data/ext/commonmarker/html.c +1 -1
  24. data/ext/commonmarker/inlines.c +1 -1
  25. data/ext/commonmarker/inlines.h +1 -1
  26. data/ext/commonmarker/iterator.c +1 -1
  27. data/ext/commonmarker/iterator.h +1 -1
  28. data/ext/commonmarker/latex.c +1 -1
  29. data/ext/commonmarker/linked_list.c +1 -1
  30. data/ext/commonmarker/man.c +1 -1
  31. data/ext/commonmarker/node.h +4 -4
  32. data/ext/commonmarker/plugin.h +2 -2
  33. data/ext/commonmarker/references.c +1 -1
  34. data/ext/commonmarker/registry.c +1 -1
  35. data/ext/commonmarker/registry.h +4 -4
  36. data/ext/commonmarker/render.c +1 -1
  37. data/ext/commonmarker/scanners.h +1 -1
  38. data/ext/commonmarker/strikethrough.c +1 -2
  39. data/ext/commonmarker/strikethrough.h +3 -3
  40. data/ext/commonmarker/syntax_extension.c +1 -1
  41. data/ext/commonmarker/syntax_extension.h +2 -2
  42. data/ext/commonmarker/table.c +10 -5
  43. data/ext/commonmarker/table.h +3 -3
  44. data/ext/commonmarker/tagfilter.h +3 -3
  45. data/ext/commonmarker/utf8.h +6 -6
  46. data/ext/commonmarker/xml.c +1 -1
  47. data/lib/commonmarker/renderer/html_renderer.rb +5 -5
  48. data/lib/commonmarker/version.rb +1 -2
  49. data/test/test_extensions.rb +3 -1
  50. metadata +8 -8
  51. data/ext/commonmarker/cmark_export.h +0 -42
  52. data/ext/commonmarker/cmark_version.h +0 -8
  53. data/ext/commonmarker/cmarkextensions_export.h +0 -42
  54. data/ext/commonmarker/core-extensions.h +0 -25
@@ -1,7 +1,7 @@
1
1
  #include <stdlib.h>
2
2
  #include <assert.h>
3
3
 
4
- #include "cmark.h"
4
+ #include "cmark-gfm.h"
5
5
  #include "syntax_extension.h"
6
6
  #include "buffer.h"
7
7
 
@@ -1,8 +1,8 @@
1
1
  #ifndef CMARK_SYNTAX_EXTENSION_H
2
2
  #define CMARK_SYNTAX_EXTENSION_H
3
3
 
4
- #include "cmark.h"
5
- #include "cmark_extension_api.h"
4
+ #include "cmark-gfm.h"
5
+ #include "cmark-gfm-extension_api.h"
6
6
  #include "config.h"
7
7
 
8
8
  struct cmark_syntax_extension {
@@ -1,4 +1,4 @@
1
- #include <cmark_extension_api.h>
1
+ #include <cmark-gfm-extension_api.h>
2
2
  #include <html.h>
3
3
  #include <inlines.h>
4
4
  #include <parser.h>
@@ -578,10 +578,15 @@ static void html_render(cmark_syntax_extension *extension,
578
578
  cmark_strbuf_putc(html, '>');
579
579
  table_state->need_closing_table_body = false;
580
580
  } else {
581
- if (table_state->need_closing_table_body)
581
+ if (table_state->need_closing_table_body) {
582
+ cmark_html_render_cr(html);
582
583
  cmark_strbuf_puts(html, "</tbody>");
584
+ cmark_html_render_cr(html);
585
+ }
583
586
  table_state->need_closing_table_body = false;
584
- cmark_strbuf_puts(html, "</table>\n");
587
+ cmark_html_render_cr(html);
588
+ cmark_strbuf_puts(html, "</table>");
589
+ cmark_html_render_cr(html);
585
590
  }
586
591
  } else if (node->type == CMARK_NODE_TABLE_ROW) {
587
592
  if (entering) {
@@ -680,14 +685,14 @@ cmark_syntax_extension *create_table_extension(void) {
680
685
  return self;
681
686
  }
682
687
 
683
- uint16_t cmarkextensions_get_table_columns(cmark_node *node) {
688
+ uint16_t cmark_gfm_extensions_get_table_columns(cmark_node *node) {
684
689
  if (node->type != CMARK_NODE_TABLE)
685
690
  return 0;
686
691
 
687
692
  return ((node_table *)node->as.opaque)->n_columns;
688
693
  }
689
694
 
690
- uint8_t *cmarkextensions_get_table_alignments(cmark_node *node) {
695
+ uint8_t *cmark_gfm_extensions_get_table_alignments(cmark_node *node) {
691
696
  if (node->type != CMARK_NODE_TABLE)
692
697
  return 0;
693
698
 
@@ -1,7 +1,7 @@
1
- #ifndef TABLE_H
2
- #define TABLE_H
1
+ #ifndef CMARK_GFM_TABLE_H
2
+ #define CMARK_GFM_TABLE_H
3
3
 
4
- #include "core-extensions.h"
4
+ #include "cmark-gfm-core-extensions.h"
5
5
 
6
6
 
7
7
  extern cmark_node_type CMARK_NODE_TABLE, CMARK_NODE_TABLE_ROW,
@@ -1,7 +1,7 @@
1
- #ifndef TAGFILTER_H
2
- #define TAGFILTER_H
1
+ #ifndef CMARK_GFM_TAGFILTER_H
2
+ #define CMARK_GFM_TAGFILTER_H
3
3
 
4
- #include "core-extensions.h"
4
+ #include "cmark-gfm-core-extensions.h"
5
5
 
6
6
  cmark_syntax_extension *create_tagfilter_extension(void);
7
7
 
@@ -8,24 +8,24 @@
8
8
  extern "C" {
9
9
  #endif
10
10
 
11
- CMARK_EXPORT
11
+ CMARK_GFM_EXPORT
12
12
  void cmark_utf8proc_case_fold(cmark_strbuf *dest, const uint8_t *str,
13
13
  bufsize_t len);
14
14
 
15
- CMARK_EXPORT
15
+ CMARK_GFM_EXPORT
16
16
  void cmark_utf8proc_encode_char(int32_t uc, cmark_strbuf *buf);
17
17
 
18
- CMARK_EXPORT
18
+ CMARK_GFM_EXPORT
19
19
  int cmark_utf8proc_iterate(const uint8_t *str, bufsize_t str_len, int32_t *dst);
20
20
 
21
- CMARK_EXPORT
21
+ CMARK_GFM_EXPORT
22
22
  void cmark_utf8proc_check(cmark_strbuf *dest, const uint8_t *line,
23
23
  bufsize_t size);
24
24
 
25
- CMARK_EXPORT
25
+ CMARK_GFM_EXPORT
26
26
  int cmark_utf8proc_is_space(int32_t uc);
27
27
 
28
- CMARK_EXPORT
28
+ CMARK_GFM_EXPORT
29
29
  int cmark_utf8proc_is_punctuation(int32_t uc);
30
30
 
31
31
  #ifdef __cplusplus
@@ -4,7 +4,7 @@
4
4
  #include <assert.h>
5
5
 
6
6
  #include "config.h"
7
- #include "cmark.h"
7
+ #include "cmark-gfm.h"
8
8
  #include "node.h"
9
9
  #include "buffer.h"
10
10
  #include "houdini.h"
@@ -174,7 +174,7 @@ module CommonMarker
174
174
  @alignments = node.table_alignments
175
175
  @needs_close_tbody = false
176
176
  out("<table#{sourcepos(node)}>\n", :children)
177
- out("</tbody>") if @needs_close_tbody
177
+ out("</tbody>\n") if @needs_close_tbody
178
178
  out("</table>\n")
179
179
  end
180
180
 
@@ -182,7 +182,7 @@ module CommonMarker
182
182
  @column_index = 0
183
183
 
184
184
  @in_header = true
185
- out("<thead>\n<tr#{sourcepos(node)}>", :children, "\n</tr>\n</thead>")
185
+ out("<thead>\n<tr#{sourcepos(node)}>\n", :children, "</tr>\n</thead>\n")
186
186
  @in_header = false
187
187
  end
188
188
 
@@ -190,9 +190,9 @@ module CommonMarker
190
190
  @column_index = 0
191
191
  if !@in_header && !@needs_close_tbody
192
192
  @needs_close_tbody = true
193
- out("\n<tbody>")
193
+ out("<tbody>\n")
194
194
  end
195
- out("\n<tr#{sourcepos(node)}>", :children, "\n</tr>")
195
+ out("<tr#{sourcepos(node)}>\n", :children, "</tr>\n")
196
196
  end
197
197
 
198
198
  def table_cell(node)
@@ -202,7 +202,7 @@ module CommonMarker
202
202
  when :center; ' align="center"'
203
203
  else; ''
204
204
  end
205
- out(@in_header ? "\n<th#{align}#{sourcepos(node)}>" : "\n<td#{align}#{sourcepos(node)}>", :children, @in_header ? "</th>" : "</td>")
205
+ out(@in_header ? "<th#{align}#{sourcepos(node)}>" : "<td#{align}#{sourcepos(node)}>", :children, @in_header ? "</th>\n" : "</td>\n")
206
206
  @column_index += 1
207
207
  end
208
208
 
@@ -1,4 +1,3 @@
1
1
  module CommonMarker
2
- VERSION = '0.17.11'.freeze
2
+ VERSION = '0.17.12'.freeze
3
3
  end
4
-
@@ -95,7 +95,9 @@ Another extension:
95
95
  <td style="text-align: center">hhh</td>
96
96
  <td>iii</td>
97
97
  <td style="text-align: right">jjj</td>
98
- </tr></tbody></table>
98
+ </tr>
99
+ </tbody>
100
+ </table>
99
101
  HTML
100
102
  aaa | bbb | ccc | ddd | eee
101
103
  :-- | --- | :-: | --- | --:
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.11
4
+ version: 0.17.12
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: 2018-08-10 00:00:00.000000000 Z
12
+ date: 2018-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-enum
@@ -131,20 +131,20 @@ files:
131
131
  - ext/commonmarker/buffer.h
132
132
  - ext/commonmarker/case_fold_switch.inc
133
133
  - ext/commonmarker/chunk.h
134
+ - ext/commonmarker/cmark-gfm-core-extensions.h
135
+ - ext/commonmarker/cmark-gfm-extension_api.h
136
+ - ext/commonmarker/cmark-gfm-extensions_export.h
137
+ - ext/commonmarker/cmark-gfm.h
138
+ - ext/commonmarker/cmark-gfm_export.h
139
+ - ext/commonmarker/cmark-gfm_version.h
134
140
  - ext/commonmarker/cmark.c
135
- - ext/commonmarker/cmark.h
136
141
  - ext/commonmarker/cmark_ctype.c
137
142
  - ext/commonmarker/cmark_ctype.h
138
- - ext/commonmarker/cmark_export.h
139
- - ext/commonmarker/cmark_extension_api.h
140
- - ext/commonmarker/cmark_version.h
141
- - ext/commonmarker/cmarkextensions_export.h
142
143
  - ext/commonmarker/commonmark.c
143
144
  - ext/commonmarker/commonmarker.c
144
145
  - ext/commonmarker/commonmarker.h
145
146
  - ext/commonmarker/config.h
146
147
  - ext/commonmarker/core-extensions.c
147
- - ext/commonmarker/core-extensions.h
148
148
  - ext/commonmarker/entities.inc
149
149
  - ext/commonmarker/ext_scanners.c
150
150
  - ext/commonmarker/ext_scanners.h
@@ -1,42 +0,0 @@
1
-
2
- #ifndef CMARK_EXPORT_H
3
- #define CMARK_EXPORT_H
4
-
5
- #ifdef CMARK_STATIC_DEFINE
6
- # define CMARK_EXPORT
7
- # define CMARK_NO_EXPORT
8
- #else
9
- # ifndef CMARK_EXPORT
10
- # ifdef libcmark_gfm_EXPORTS
11
- /* We are building this library */
12
- # define CMARK_EXPORT __attribute__((visibility("default")))
13
- # else
14
- /* We are using this library */
15
- # define CMARK_EXPORT __attribute__((visibility("default")))
16
- # endif
17
- # endif
18
-
19
- # ifndef CMARK_NO_EXPORT
20
- # define CMARK_NO_EXPORT __attribute__((visibility("hidden")))
21
- # endif
22
- #endif
23
-
24
- #ifndef CMARK_DEPRECATED
25
- # define CMARK_DEPRECATED __attribute__ ((__deprecated__))
26
- #endif
27
-
28
- #ifndef CMARK_DEPRECATED_EXPORT
29
- # define CMARK_DEPRECATED_EXPORT CMARK_EXPORT CMARK_DEPRECATED
30
- #endif
31
-
32
- #ifndef CMARK_DEPRECATED_NO_EXPORT
33
- # define CMARK_DEPRECATED_NO_EXPORT CMARK_NO_EXPORT CMARK_DEPRECATED
34
- #endif
35
-
36
- #if 0 /* DEFINE_NO_DEPRECATED */
37
- # ifndef CMARK_NO_DEPRECATED
38
- # define CMARK_NO_DEPRECATED
39
- # endif
40
- #endif
41
-
42
- #endif
@@ -1,8 +0,0 @@
1
- #ifndef CMARK_VERSION_H
2
- #define CMARK_VERSION_H
3
-
4
- #define CMARK_VERSION ((0 << 24) | (28 << 16) | (3 << 8) | 14)
5
- #define CMARK_VERSION_STRING "0.28.3.gfm.14"
6
- #define CMARK_GFM_VERSION 14
7
-
8
- #endif
@@ -1,42 +0,0 @@
1
-
2
- #ifndef CMARKEXTENSIONS_EXPORT_H
3
- #define CMARKEXTENSIONS_EXPORT_H
4
-
5
- #ifdef CMARKEXTENSIONS_STATIC_DEFINE
6
- # define CMARKEXTENSIONS_EXPORT
7
- # define CMARKEXTENSIONS_NO_EXPORT
8
- #else
9
- # ifndef CMARKEXTENSIONS_EXPORT
10
- # ifdef libcmark_gfmextensions_EXPORTS
11
- /* We are building this library */
12
- # define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
13
- # else
14
- /* We are using this library */
15
- # define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
16
- # endif
17
- # endif
18
-
19
- # ifndef CMARKEXTENSIONS_NO_EXPORT
20
- # define CMARKEXTENSIONS_NO_EXPORT __attribute__((visibility("hidden")))
21
- # endif
22
- #endif
23
-
24
- #ifndef CMARKEXTENSIONS_DEPRECATED
25
- # define CMARKEXTENSIONS_DEPRECATED __attribute__ ((__deprecated__))
26
- #endif
27
-
28
- #ifndef CMARKEXTENSIONS_DEPRECATED_EXPORT
29
- # define CMARKEXTENSIONS_DEPRECATED_EXPORT CMARKEXTENSIONS_EXPORT CMARKEXTENSIONS_DEPRECATED
30
- #endif
31
-
32
- #ifndef CMARKEXTENSIONS_DEPRECATED_NO_EXPORT
33
- # define CMARKEXTENSIONS_DEPRECATED_NO_EXPORT CMARKEXTENSIONS_NO_EXPORT CMARKEXTENSIONS_DEPRECATED
34
- #endif
35
-
36
- #if 0 /* DEFINE_NO_DEPRECATED */
37
- # ifndef CMARKEXTENSIONS_NO_DEPRECATED
38
- # define CMARKEXTENSIONS_NO_DEPRECATED
39
- # endif
40
- #endif
41
-
42
- #endif
@@ -1,25 +0,0 @@
1
- #ifndef CORE_EXTENSIONS_H
2
- #define CORE_EXTENSIONS_H
3
-
4
- #ifdef __cplusplus
5
- extern "C" {
6
- #endif
7
-
8
- #include "cmark_extension_api.h"
9
- #include "cmarkextensions_export.h"
10
- #include <stdint.h>
11
-
12
- CMARKEXTENSIONS_EXPORT
13
- void core_extensions_ensure_registered(void);
14
-
15
- CMARKEXTENSIONS_EXPORT
16
- uint16_t cmarkextensions_get_table_columns(cmark_node *node);
17
-
18
- CMARKEXTENSIONS_EXPORT
19
- uint8_t *cmarkextensions_get_table_alignments(cmark_node *node);
20
-
21
- #ifdef __cplusplus
22
- }
23
- #endif
24
-
25
- #endif