commonmarker 0.10.0 → 0.11.0

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 (161) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -0
  3. data/bin/commonmarker +19 -3
  4. data/ext/commonmarker/cmark/CMakeLists.txt +1 -0
  5. data/ext/commonmarker/cmark/COPYING +2 -24
  6. data/ext/commonmarker/cmark/Makefile +25 -5
  7. data/ext/commonmarker/cmark/README.md +1 -1
  8. data/ext/commonmarker/cmark/api_test/CMakeLists.txt +1 -1
  9. data/ext/commonmarker/cmark/api_test/main.c +25 -27
  10. data/ext/commonmarker/cmark/build/CMakeCache.txt +12 -9
  11. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeCCompiler.cmake +0 -0
  12. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeCXXCompiler.cmake +0 -0
  13. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeDetermineCompilerABI_C.bin +0 -0
  14. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeDetermineCompilerABI_CXX.bin +0 -0
  15. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CMakeSystem.cmake +4 -4
  16. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdC/CMakeCCompilerId.c +0 -0
  17. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdC/a.out +0 -0
  18. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -0
  19. data/ext/commonmarker/cmark/build/CMakeFiles/{3.6.0 → 3.6.1}/CompilerIdCXX/a.out +0 -0
  20. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeError.log +6 -6
  21. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeOutput.log +148 -148
  22. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile.cmake +41 -109
  23. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile2 +66 -10
  24. data/ext/commonmarker/cmark/build/CMakeFiles/TargetDirectories.txt +8 -0
  25. data/ext/commonmarker/cmark/build/CMakeFiles/progress.marks +1 -1
  26. data/ext/commonmarker/cmark/build/CTestTestfile.cmake +1 -0
  27. data/ext/commonmarker/cmark/build/Makefile +23 -9
  28. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/build.make +2 -2
  29. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/progress.marks +1 -1
  30. data/ext/commonmarker/cmark/build/api_test/Makefile +9 -9
  31. data/ext/commonmarker/cmark/build/cmake_install.cmake +1 -0
  32. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  33. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/C.includecache +190 -0
  34. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/DependInfo.cmake +29 -0
  35. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/autolink.c.o +0 -0
  36. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/build.make +249 -0
  37. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/cmake_clean.cmake +15 -0
  38. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/cmake_clean_target.cmake +3 -0
  39. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/core-extensions.c.o +0 -0
  40. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/depend.internal +92 -0
  41. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/depend.make +92 -0
  42. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/ext_scanners.c.o +0 -0
  43. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/flags.make +10 -0
  44. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/link.txt +2 -0
  45. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/progress.make +8 -0
  46. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/strikethrough.c.o +0 -0
  47. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/table.c.o +0 -0
  48. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/libcmarkextensions_static.dir/whitelist.c.o +0 -0
  49. data/ext/commonmarker/cmark/build/extensions/CMakeFiles/progress.marks +1 -0
  50. data/ext/commonmarker/cmark/build/extensions/Makefile +390 -0
  51. data/ext/commonmarker/cmark/build/extensions/cmake_install.cmake +29 -0
  52. data/ext/commonmarker/cmark/build/extensions/libcmarkextensions.a +0 -0
  53. data/ext/commonmarker/cmark/build/man/Makefile +9 -9
  54. data/ext/commonmarker/cmark/build/src/CMakeFiles/Export/lib/cmake/cmark.cmake +1 -1
  55. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/DependInfo.cmake +7 -19
  56. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/build.make +6 -517
  57. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmake_clean.cmake +0 -19
  58. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/flags.make +1 -1
  59. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/link.txt +1 -1
  60. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/progress.make +0 -19
  61. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/DependInfo.cmake +9 -0
  62. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/build.make +112 -4
  63. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmake_clean.cmake +4 -0
  64. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/flags.make +1 -1
  65. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/link.txt +1 -1
  66. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/progress.make +24 -20
  67. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/C.includecache +144 -10
  68. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/DependInfo.cmake +9 -0
  69. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/blocks.c.o +0 -0
  70. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/build.make +112 -4
  71. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean.cmake +4 -0
  72. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark.c.o +0 -0
  73. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/commonmark.c.o +0 -0
  74. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.internal +74 -0
  75. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.make +74 -0
  76. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/flags.make +1 -1
  77. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/html.c.o +0 -0
  78. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/inlines.c.o +0 -0
  79. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/iterator.c.o +0 -0
  80. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/latex.c.o +0 -0
  81. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/link.txt +1 -1
  82. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/linked_list.c.o +0 -0
  83. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/man.c.o +0 -0
  84. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/node.c.o +0 -0
  85. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/plugin.c.o +0 -0
  86. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/progress.make +24 -20
  87. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/registry.c.o +0 -0
  88. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/scanners.c.o +0 -0
  89. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/syntax_extension.c.o +0 -0
  90. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/xml.c.o +0 -0
  91. data/ext/commonmarker/cmark/build/src/CMakeFiles/progress.marks +1 -1
  92. data/ext/commonmarker/cmark/build/src/Makefile +141 -66
  93. data/ext/commonmarker/cmark/build/src/cmake_install.cmake +4 -0
  94. data/ext/commonmarker/cmark/build/src/libcmark.a +0 -0
  95. data/ext/commonmarker/cmark/build/testdir/CTestTestfile.cmake +3 -1
  96. data/ext/commonmarker/cmark/build/testdir/Makefile +9 -9
  97. data/ext/commonmarker/cmark/extensions/CMakeLists.txt +82 -0
  98. data/ext/commonmarker/cmark/extensions/autolink.c +338 -0
  99. data/ext/commonmarker/cmark/extensions/autolink.h +8 -0
  100. data/ext/commonmarker/cmark/extensions/core-extensions.c +16 -0
  101. data/ext/commonmarker/cmark/extensions/core-extensions.h +16 -0
  102. data/ext/commonmarker/cmark/extensions/ext_scanners.c +585 -0
  103. data/ext/commonmarker/cmark/extensions/ext_scanners.h +20 -0
  104. data/ext/commonmarker/cmark/extensions/ext_scanners.re +65 -0
  105. data/ext/commonmarker/cmark/extensions/strikethrough.c +142 -0
  106. data/ext/commonmarker/cmark/extensions/strikethrough.h +9 -0
  107. data/ext/commonmarker/cmark/extensions/table.c +493 -0
  108. data/ext/commonmarker/cmark/extensions/table.h +8 -0
  109. data/ext/commonmarker/cmark/extensions/whitelist.c +59 -0
  110. data/ext/commonmarker/cmark/extensions/whitelist.h +8 -0
  111. data/ext/commonmarker/cmark/man/man3/cmark.3 +98 -34
  112. data/ext/commonmarker/cmark/src/CMakeLists.txt +16 -1
  113. data/ext/commonmarker/cmark/src/blocks.c +219 -40
  114. data/ext/commonmarker/cmark/src/buffer.h +36 -0
  115. data/ext/commonmarker/cmark/src/cmark.c +5 -1
  116. data/ext/commonmarker/cmark/src/cmark.h +91 -34
  117. data/ext/commonmarker/cmark/src/cmark_ctype.h +7 -0
  118. data/ext/commonmarker/cmark/src/cmark_extension_api.h +655 -0
  119. data/ext/commonmarker/cmark/src/commonmark.c +7 -2
  120. data/ext/commonmarker/cmark/src/houdini.h +12 -6
  121. data/ext/commonmarker/cmark/src/houdini_html_e.c +1 -1
  122. data/ext/commonmarker/cmark/src/html.c +102 -54
  123. data/ext/commonmarker/cmark/src/html.h +27 -0
  124. data/ext/commonmarker/cmark/src/inlines.c +261 -53
  125. data/ext/commonmarker/cmark/src/inlines.h +7 -2
  126. data/ext/commonmarker/cmark/src/iterator.c +12 -7
  127. data/ext/commonmarker/cmark/src/latex.c +5 -2
  128. data/ext/commonmarker/cmark/src/linked_list.c +37 -0
  129. data/ext/commonmarker/cmark/src/main.c +91 -27
  130. data/ext/commonmarker/cmark/src/man.c +18 -2
  131. data/ext/commonmarker/cmark/src/node.c +157 -58
  132. data/ext/commonmarker/cmark/src/node.h +23 -0
  133. data/ext/commonmarker/cmark/src/parser.h +19 -2
  134. data/ext/commonmarker/cmark/src/plugin.c +33 -0
  135. data/ext/commonmarker/cmark/src/plugin.h +34 -0
  136. data/ext/commonmarker/cmark/src/registry.c +60 -0
  137. data/ext/commonmarker/cmark/src/registry.h +24 -0
  138. data/ext/commonmarker/cmark/src/render.h +9 -0
  139. data/ext/commonmarker/cmark/src/scanners.c +265 -391
  140. data/ext/commonmarker/cmark/src/scanners.h +5 -0
  141. data/ext/commonmarker/cmark/src/scanners.re +2 -2
  142. data/ext/commonmarker/cmark/src/syntax_extension.c +110 -0
  143. data/ext/commonmarker/cmark/src/syntax_extension.h +27 -0
  144. data/ext/commonmarker/cmark/suppressions +28 -0
  145. data/ext/commonmarker/cmark/test/CMakeLists.txt +12 -1
  146. data/ext/commonmarker/cmark/test/extensions.txt +173 -0
  147. data/ext/commonmarker/cmark/test/regression.txt +24 -0
  148. data/ext/commonmarker/cmark/test/spec.txt +27 -26
  149. data/ext/commonmarker/cmark/toolchain-mingw32.cmake +1 -1
  150. data/ext/commonmarker/commonmarker.c +132 -15
  151. data/ext/commonmarker/commonmarker.h +4 -0
  152. data/ext/commonmarker/extconf.rb +12 -5
  153. data/lib/commonmarker.rb +8 -6
  154. data/lib/commonmarker/node.rb +13 -2
  155. data/lib/commonmarker/renderer.rb +1 -1
  156. data/lib/commonmarker/version.rb +1 -1
  157. data/test/test_commonmark.rb +34 -0
  158. data/test/test_encoding.rb +2 -1
  159. data/test/test_extensions.rb +50 -0
  160. data/test/test_helper.rb +2 -1
  161. metadata +65 -11
@@ -1,3 +1,6 @@
1
+ #ifndef CMARK_SCANNERS_H
2
+ #define CMARK_SCANNERS_H
3
+
1
4
  #include "cmark.h"
2
5
  #include "chunk.h"
3
6
 
@@ -55,3 +58,5 @@ bufsize_t _scan_dangerous_url(const unsigned char *p);
55
58
  #ifdef __cplusplus
56
59
  }
57
60
  #endif
61
+
62
+ #endif
@@ -37,7 +37,7 @@ bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c,
37
37
 
38
38
  tagname = [A-Za-z][A-Za-z0-9-]*;
39
39
 
40
- blocktagname = 'address'|'article'|'aside'|'base'|'basefont'|'blockquote'|'body'|'caption'|'center'|'col'|'colgroup'|'dd'|'details'|'dialog'|'dir'|'div'|'dl'|'dt'|'fieldset'|'figcaption'|'figure'|'footer'|'form'|'frame'|'frameset'|'h1'|'head'|'header'|'hr'|'html'|'iframe'|'legend'|'li'|'link'|'main'|'menu'|'menuitem'|'meta'|'nav'|'noframes'|'ol'|'optgroup'|'option'|'p'|'param'|'section'|'source'|'title'|'summary'|'table'|'tbody'|'td'|'tfoot'|'th'|'thead'|'title'|'tr'|'track'|'ul';
40
+ blocktagname = 'address'|'article'|'aside'|'base'|'basefont'|'blockquote'|'body'|'caption'|'center'|'col'|'colgroup'|'dd'|'details'|'dialog'|'dir'|'div'|'dl'|'dt'|'fieldset'|'figcaption'|'figure'|'footer'|'form'|'frame'|'frameset'|'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'head'|'header'|'hr'|'html'|'iframe'|'legend'|'li'|'link'|'main'|'menu'|'menuitem'|'meta'|'nav'|'noframes'|'ol'|'optgroup'|'option'|'p'|'param'|'section'|'source'|'title'|'summary'|'table'|'tbody'|'td'|'tfoot'|'th'|'thead'|'title'|'tr'|'track'|'ul';
41
41
 
42
42
  attributename = [a-zA-Z_:][a-zA-Z0-9:._-]*;
43
43
 
@@ -71,7 +71,7 @@ bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c,
71
71
  in_single_quotes = ['] (escaped_char|[^'\x00])* ['];
72
72
  in_parens = [(] (escaped_char|[^)\x00])* [)];
73
73
 
74
- scheme = [A-Za-z ][A-Za-z.+-]{1,31};
74
+ scheme = [A-Za-z][A-Za-z0-9.+-]{1,31};
75
75
  */
76
76
 
77
77
  // Try to match a scheme including colon.
@@ -0,0 +1,110 @@
1
+ #include <stdlib.h>
2
+
3
+ #include "cmark.h"
4
+ #include "syntax_extension.h"
5
+ #include "buffer.h"
6
+
7
+ void cmark_syntax_extension_free(cmark_syntax_extension *extension) {
8
+ if (extension->free_function && extension->priv) {
9
+ extension->free_function(extension->priv);
10
+ }
11
+
12
+ cmark_llist_free(extension->special_inline_chars);
13
+ free(extension->name);
14
+ free(extension);
15
+ }
16
+
17
+ cmark_syntax_extension *cmark_syntax_extension_new(const char *name) {
18
+ cmark_syntax_extension *res = (cmark_syntax_extension *) calloc(1, sizeof(cmark_syntax_extension));
19
+ res->name = (char *) malloc(sizeof(char) * (strlen(name)) + 1);
20
+ strcpy(res->name, name);
21
+ return res;
22
+ }
23
+
24
+ cmark_node_type cmark_syntax_extension_add_node(int is_inline) {
25
+ cmark_node_type *ref = !is_inline ? &CMARK_NODE_LAST_BLOCK : &CMARK_NODE_LAST_INLINE;
26
+
27
+ if ((*ref & CMARK_NODE_VALUE_MASK) == CMARK_NODE_VALUE_MASK) {
28
+ assert(false);
29
+ return (cmark_node_type) 0;
30
+ }
31
+
32
+ return *ref = (cmark_node_type) ((int) *ref + 1);
33
+ }
34
+
35
+ void cmark_syntax_extension_set_open_block_func(cmark_syntax_extension *extension,
36
+ cmark_open_block_func func) {
37
+ extension->try_opening_block = func;
38
+ }
39
+
40
+ void cmark_syntax_extension_set_match_block_func(cmark_syntax_extension *extension,
41
+ cmark_match_block_func func) {
42
+ extension->last_block_matches = func;
43
+ }
44
+
45
+ void cmark_syntax_extension_set_match_inline_func(cmark_syntax_extension *extension,
46
+ cmark_match_inline_func func) {
47
+ extension->match_inline = func;
48
+ }
49
+
50
+ void cmark_syntax_extension_set_inline_from_delim_func(cmark_syntax_extension *extension,
51
+ cmark_inline_from_delim_func func) {
52
+ extension->insert_inline_from_delim = func;
53
+ }
54
+
55
+ void cmark_syntax_extension_set_special_inline_chars(cmark_syntax_extension *extension,
56
+ cmark_llist *special_chars) {
57
+ extension->special_inline_chars = special_chars;
58
+ }
59
+
60
+ void cmark_syntax_extension_set_get_type_string_func(cmark_syntax_extension *extension,
61
+ cmark_get_type_string_func func) {
62
+ extension->get_type_string_func = func;
63
+ }
64
+
65
+ void cmark_syntax_extension_set_can_contain_func(cmark_syntax_extension *extension,
66
+ cmark_can_contain_func func) {
67
+ extension->can_contain_func = func;
68
+ }
69
+
70
+ void cmark_syntax_extension_set_contains_inlines_func(cmark_syntax_extension *extension,
71
+ cmark_contains_inlines_func func) {
72
+ extension->contains_inlines_func = func;
73
+ }
74
+
75
+ void cmark_syntax_extension_set_commonmark_render_func(cmark_syntax_extension *extension,
76
+ cmark_common_render_func func) {
77
+ extension->commonmark_render_func = func;
78
+ }
79
+
80
+ void cmark_syntax_extension_set_latex_render_func(cmark_syntax_extension *extension,
81
+ cmark_common_render_func func) {
82
+ extension->latex_render_func = func;
83
+ }
84
+
85
+ void cmark_syntax_extension_set_man_render_func(cmark_syntax_extension *extension,
86
+ cmark_common_render_func func) {
87
+ extension->man_render_func = func;
88
+ }
89
+
90
+ void cmark_syntax_extension_set_html_render_func(cmark_syntax_extension *extension,
91
+ cmark_html_render_func func) {
92
+ extension->html_render_func = func;
93
+ }
94
+
95
+ void cmark_syntax_extension_set_html_filter_func(cmark_syntax_extension *extension,
96
+ cmark_html_filter_func func) {
97
+ extension->html_filter_func = func;
98
+ }
99
+
100
+ void cmark_syntax_extension_set_postprocess_func(cmark_syntax_extension *extension,
101
+ cmark_postprocess_func func) {
102
+ extension->postprocess_func = func;
103
+ }
104
+
105
+ void cmark_syntax_extension_set_private(cmark_syntax_extension *extension,
106
+ void *priv,
107
+ cmark_free_func free_func) {
108
+ extension->priv = priv;
109
+ extension->free_function = free_func;
110
+ }
@@ -0,0 +1,27 @@
1
+ #ifndef CMARK_SYNTAX_EXTENSION_H
2
+ #define CMARK_SYNTAX_EXTENSION_H
3
+
4
+ #include "cmark.h"
5
+ #include "cmark_extension_api.h"
6
+
7
+ struct cmark_syntax_extension {
8
+ cmark_match_block_func last_block_matches;
9
+ cmark_open_block_func try_opening_block;
10
+ cmark_match_inline_func match_inline;
11
+ cmark_inline_from_delim_func insert_inline_from_delim;
12
+ cmark_llist * special_inline_chars;
13
+ char * name;
14
+ void * priv;
15
+ cmark_free_func free_function;
16
+ cmark_get_type_string_func get_type_string_func;
17
+ cmark_can_contain_func can_contain_func;
18
+ cmark_contains_inlines_func contains_inlines_func;
19
+ cmark_common_render_func commonmark_render_func;
20
+ cmark_common_render_func latex_render_func;
21
+ cmark_common_render_func man_render_func;
22
+ cmark_html_render_func html_render_func;
23
+ cmark_html_filter_func html_filter_func;
24
+ cmark_postprocess_func postprocess_func;
25
+ };
26
+
27
+ #endif
@@ -0,0 +1,28 @@
1
+ {
2
+ .
3
+ Memcheck:Leak
4
+ match-leak-kinds: possible
5
+ fun:malloc_zone_malloc
6
+ fun:_objc_copyClassNamesForImage
7
+ fun:_ZL9protocolsv
8
+ fun:_Z9readClassP10objc_classbb
9
+ fun:gc_init
10
+ fun:_ZL33objc_initializeClassPair_internalP10objc_classPKcS0_S0_
11
+ fun:layout_string_create
12
+ fun:_ZL12realizeClassP10objc_class
13
+ fun:_ZL22copySwiftV1MangledNamePKcb
14
+ fun:_ZL22copySwiftV1MangledNamePKcb
15
+ fun:_ZL22copySwiftV1MangledNamePKcb
16
+ fun:_ZL22copySwiftV1MangledNamePKcb
17
+ }
18
+ {
19
+ .
20
+ Memcheck:Leak
21
+ match-leak-kinds: reachable
22
+ fun:malloc
23
+ fun:__smakebuf
24
+ fun:__srefill0
25
+ fun:__fread
26
+ fun:fread
27
+ fun:main
28
+ }
@@ -46,13 +46,24 @@ IF (PYTHONINTERP_FOUND)
46
46
  ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/smart_punct.txt" "--program" "${CMAKE_CURRENT_BINARY_DIR}/../src/cmark --smart"
47
47
  )
48
48
 
49
- add_test(roundtriptest_executable
49
+ add_test(extensions_executable
50
+ ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/extensions.txt" "--program" "${CMAKE_CURRENT_BINARY_DIR}/../src/cmark -e table -e strikethrough -e whitelist -e autolink"
51
+ )
52
+
53
+ add_test(roundtriptest_library
50
54
  ${PYTHON_EXECUTABLE}
51
55
  "${CMAKE_CURRENT_SOURCE_DIR}/roundtrip_tests.py"
52
56
  "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/spec.txt"
53
57
  "--library-dir" "${CMAKE_CURRENT_BINARY_DIR}/../src"
54
58
  )
55
59
 
60
+ add_test(roundtrip_extensions_executable
61
+ ${PYTHON_EXECUTABLE}
62
+ "${CMAKE_CURRENT_SOURCE_DIR}/roundtrip_tests.py"
63
+ "--spec" "${CMAKE_CURRENT_SOURCE_DIR}/extensions.txt"
64
+ "--program" "${CMAKE_CURRENT_BINARY_DIR}/../src/cmark -e table -e strikethrough -e whitelist -e autolink"
65
+ )
66
+
56
67
  add_test(regressiontest_executable
57
68
  ${PYTHON_EXECUTABLE}
58
69
  "${CMAKE_CURRENT_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
@@ -0,0 +1,173 @@
1
+ ---
2
+ title: Extensions test
3
+ author: Yuki Izumi
4
+ version: 0.1
5
+ date: '2016-08-31'
6
+ license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
7
+ ...
8
+
9
+ ## Tables
10
+
11
+ Here's a well-formed table, doing everything it should.
12
+
13
+ ```````````````````````````````` example
14
+ | abc | def |
15
+ | --- | --- |
16
+ | ghi | jkl |
17
+ | mno | pqr |
18
+ .
19
+ <table>
20
+ <thead>
21
+ <tr>
22
+ <th> abc</th>
23
+ <th> def</th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ <tr>
28
+ <td> ghi</td>
29
+ <td> jkl</td>
30
+ </tr>
31
+ <tr>
32
+ <td> mno</td>
33
+ <td> pqr</td>
34
+ </tr></tbody></table>
35
+ ````````````````````````````````
36
+
37
+ We're going to mix up the table now; we'll demonstrate that inline formatting
38
+ works fine, but block elements don't. You can also have empty cells, and the
39
+ textual alignment of the columns is shown to be irrelevant.
40
+
41
+ ```````````````````````````````` example
42
+ Hello!
43
+
44
+ | _abc_ | セン |
45
+ | ----- | ---- |
46
+ | 1. Block elements inside cells don't work. | |
47
+ | But **_inline elements do_**. | x |
48
+
49
+ Hi!
50
+ .
51
+ <p>Hello!</p>
52
+ <table>
53
+ <thead>
54
+ <tr>
55
+ <th> <em>abc</em></th>
56
+ <th> セン</th>
57
+ </tr>
58
+ </thead>
59
+ <tbody>
60
+ <tr>
61
+ <td> 1. Block elements inside cells don't work.</td>
62
+ <td></td>
63
+ </tr>
64
+ <tr>
65
+ <td> But <strong><em>inline elements do</em></strong>.</td>
66
+ <td> x</td>
67
+ </tr></tbody></table>
68
+ <p>Hi!</p>
69
+ ````````````````````````````````
70
+
71
+ Here we demonstrate some edge cases about what is and isn't a table.
72
+
73
+ ```````````````````````````````` example
74
+ | Not enough table | to be considered table |
75
+
76
+ | Not enough table | to be considered table |
77
+ | Not enough table | to be considered table |
78
+
79
+ | Just enough table | to be considered table |
80
+ | ----------------- | ---------------------- |
81
+
82
+ | ---- | --- |
83
+
84
+ | x |
85
+ | - |
86
+ .
87
+ <p>| Not enough table | to be considered table |</p>
88
+ <p>| Not enough table | to be considered table |
89
+ | Not enough table | to be considered table |</p>
90
+ <table>
91
+ <thead>
92
+ <tr>
93
+ <th> Just enough table</th>
94
+ <th> to be considered table</th>
95
+ </tr>
96
+ </thead>
97
+ <tbody></tbody></table>
98
+ <p>| ---- | --- |</p>
99
+ <table>
100
+ <thead>
101
+ <tr>
102
+ <th> x</th>
103
+ </tr>
104
+ </thead>
105
+ <tbody></tbody></table>
106
+ ````````````````````````````````
107
+
108
+
109
+ ## Strikethroughs
110
+
111
+ A well-formed strikethrough.
112
+
113
+ ```````````````````````````````` example
114
+ A proper ~strikethrough~.
115
+ .
116
+ <p>A proper <del>strikethrough</del>.</p>
117
+ ````````````````````````````````
118
+
119
+ Some strikethrough edge cases.
120
+
121
+ ```````````````````````````````` example
122
+ These are ~not strikethroughs.
123
+
124
+ No, they are not~
125
+
126
+ This ~is ~ legit~ isn't ~ legit.
127
+
128
+ This is just ~~~~~one~~~~~ huge strikethrough.
129
+ .
130
+ <p>These are ~not strikethroughs.</p>
131
+ <p>No, they are not~</p>
132
+ <p>This <del>is ~ legit</del> isn't ~ legit.</p>
133
+ <p>This is just <del>one</del> huge strikethrough.</p>
134
+ ````````````````````````````````
135
+
136
+
137
+ ## HTML whitelist
138
+
139
+
140
+ ```````````````````````````````` example
141
+ This is <xmp> not okay, but **this** <strong>is</strong>.
142
+
143
+ <p>This is <xmp> not okay, but **this** <strong>is</strong>.</p>
144
+
145
+ Nope, I won't have <textarea>.
146
+
147
+ <p>No <textarea> here either.</p>
148
+ .
149
+ <p>This is &lt;xmp> not okay, but <strong>this</strong> <strong>is</strong>.</p>
150
+ <p>This is &lt;xmp> not okay, but **this** <strong>is</strong>.</p>
151
+ <p>Nope, I won't have &lt;textarea>.</p>
152
+ <p>No &lt;textarea> here either.</p>
153
+ ````````````````````````````````
154
+
155
+
156
+
157
+ ## Autolinks
158
+
159
+ ```````````````````````````````` example
160
+ : http://google.com https://google.com
161
+
162
+ <http://google.com/å> http://google.com/å
163
+
164
+ scyther@pokemon.com
165
+
166
+ www.github.com www.github.com/á
167
+
168
+ .
169
+ <p>: <a href="http://google.com">http://google.com</a> <a href="https://google.com">https://google.com</a></p>
170
+ <p><a href="http://google.com/%C3%A5">http://google.com/å</a> <a href="http://google.com/%C3%A5">http://google.com/å</a></p>
171
+ <p><a href="mailto:scyther@pokemon.com">scyther@pokemon.com</a></p>
172
+ <p><a href="http://www.github.com">www.github.com</a> <a href="http://www.github.com/%C3%A1">www.github.com/á</a></p>
173
+ ````````````````````````````````
@@ -32,3 +32,27 @@ Repeatedly solving
32
32
  <li>how techniques</li>
33
33
  </ul>
34
34
  ````````````````````````````````
35
+
36
+ Issue jgm/CommonMark#430: h2..h6 not recognized as block tags.
37
+
38
+ ```````````````````````````````` example
39
+ <h1>lorem</h1>
40
+
41
+ <h2>lorem</h2>
42
+
43
+ <h3>lorem</h3>
44
+
45
+ <h4>lorem</h4>
46
+
47
+ <h5>lorem</h5>
48
+
49
+ <h6>lorem</h6>
50
+ .
51
+ <h1>lorem</h1>
52
+ <h2>lorem</h2>
53
+ <h3>lorem</h3>
54
+ <h4>lorem</h4>
55
+ <h5>lorem</h5>
56
+ <h6>lorem</h6>
57
+ ````````````````````````````````
58
+
@@ -1985,7 +1985,7 @@ by their start and end conditions. The block begins with a line that
1985
1985
  meets a [start condition](@) (after up to three spaces
1986
1986
  optional indentation). It ends with the first subsequent line that
1987
1987
  meets a matching [end condition](@), or the last line of
1988
- the document or other [container block](@), if no line is encountered that meets the
1988
+ the document or other [container block]), if no line is encountered that meets the
1989
1989
  [end condition]. If the first line meets both the [start condition]
1990
1990
  and the [end condition], the block will contain just that line.
1991
1991
 
@@ -2015,7 +2015,8 @@ followed by one of the strings (case-insensitive) `address`,
2015
2015
  `article`, `aside`, `base`, `basefont`, `blockquote`, `body`,
2016
2016
  `caption`, `center`, `col`, `colgroup`, `dd`, `details`, `dialog`,
2017
2017
  `dir`, `div`, `dl`, `dt`, `fieldset`, `figcaption`, `figure`,
2018
- `footer`, `form`, `frame`, `frameset`, `h1`, `head`, `header`, `hr`,
2018
+ `footer`, `form`, `frame`, `frameset`,
2019
+ `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `head`, `header`, `hr`,
2019
2020
  `html`, `iframe`, `legend`, `li`, `link`, `main`, `menu`, `menuitem`,
2020
2021
  `meta`, `nav`, `noframes`, `ol`, `optgroup`, `option`, `p`, `param`,
2021
2022
  `section`, `source`, `summary`, `table`, `tbody`, `td`,
@@ -4730,8 +4731,7 @@ takes four spaces (a common case), but diverge in other cases.
4730
4731
 
4731
4732
  A [list](@) is a sequence of one or more
4732
4733
  list items [of the same type]. The list items
4733
- may be separated by single [blank lines], but two
4734
- blank lines end all containing lists.
4734
+ may be separated by any number of blank lines.
4735
4735
 
4736
4736
  Two list items are [of the same type](@)
4737
4737
  if they begin with a [list marker] of the same type.
@@ -4809,10 +4809,11 @@ Foo
4809
4809
  `Markdown.pl` does not allow this, through fear of triggering a list
4810
4810
  via a numeral in a hard-wrapped line:
4811
4811
 
4812
- ```````````````````````````````` markdown
4812
+ ``` markdown
4813
4813
  The number of windows in my house is
4814
4814
  14. The number of doors is 6.
4815
- ````````````````````````````````
4815
+ ```
4816
+
4816
4817
  Oddly, though, `Markdown.pl` *does* allow a blockquote to
4817
4818
  interrupt a paragraph, even though the same considerations might
4818
4819
  apply.
@@ -4821,10 +4822,12 @@ In CommonMark, we do allow lists to interrupt paragraphs, for
4821
4822
  two reasons. First, it is natural and not uncommon for people
4822
4823
  to start lists without blank lines:
4823
4824
 
4824
- I need to buy
4825
- - new shoes
4826
- - a coat
4827
- - a plane ticket
4825
+ ``` markdown
4826
+ I need to buy
4827
+ - new shoes
4828
+ - a coat
4829
+ - a plane ticket
4830
+ ```
4828
4831
 
4829
4832
  Second, we are attracted to a
4830
4833
 
@@ -4836,20 +4839,24 @@ Second, we are attracted to a
4836
4839
  (Indeed, the spec for [list items] and [block quotes] presupposes
4837
4840
  this principle.) This principle implies that if
4838
4841
 
4839
- * I need to buy
4840
- - new shoes
4841
- - a coat
4842
- - a plane ticket
4842
+ ``` markdown
4843
+ * I need to buy
4844
+ - new shoes
4845
+ - a coat
4846
+ - a plane ticket
4847
+ ```
4843
4848
 
4844
4849
  is a list item containing a paragraph followed by a nested sublist,
4845
4850
  as all Markdown implementations agree it is (though the paragraph
4846
4851
  may be rendered without `<p>` tags, since the list is "tight"),
4847
4852
  then
4848
4853
 
4849
- I need to buy
4850
- - new shoes
4851
- - a coat
4852
- - a plane ticket
4854
+ ``` markdown
4855
+ I need to buy
4856
+ - new shoes
4857
+ - a coat
4858
+ - a plane ticket
4859
+ ```
4853
4860
 
4854
4861
  by itself should be a paragraph followed by a nested sublist.
4855
4862
 
@@ -6558,7 +6565,7 @@ Note that in the preceding case, the interpretation
6558
6565
 
6559
6566
 
6560
6567
  is precluded by the condition that a delimiter that
6561
- can both open and close (like the `*` after `foo`
6568
+ can both open and close (like the `*` after `foo`)
6562
6569
  cannot form emphasis if the sum of the lengths of
6563
6570
  the delimiter runs containing the opening and
6564
6571
  closing delimiters is a multiple of 3.
@@ -6590,12 +6597,6 @@ omitted:
6590
6597
  ````````````````````````````````
6591
6598
 
6592
6599
 
6593
- ```````````````````````````````` example
6594
- *foo**bar***
6595
- .
6596
- <p><em>foo<strong>bar</strong></em></p>
6597
- ````````````````````````````````
6598
-
6599
6600
  Indefinite levels of nesting are possible:
6600
6601
 
6601
6602
  ```````````````````````````````` example
@@ -9045,7 +9046,7 @@ blocks. But we cannot close unmatched blocks yet, because we may have a
9045
9046
  [lazy continuation line].
9046
9047
 
9047
9048
  2. Next, after consuming the continuation markers for existing
9048
- blocks, we look for new block starts (e.g. `>` for a block quote.
9049
+ blocks, we look for new block starts (e.g. `>` for a block quote).
9049
9050
  If we encounter a new block start, we close any blocks unmatched
9050
9051
  in step 1 before creating the new block as a child of the last
9051
9052
  matched block.