commonmarker 0.0.1

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 (291) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +119 -0
  5. data/Rakefile +39 -0
  6. data/bin/commonmarker +41 -0
  7. data/commonmarker.gemspec +30 -0
  8. data/ext/commonmarker/cmark/CMakeLists.txt +25 -0
  9. data/ext/commonmarker/cmark/COPYING +192 -0
  10. data/ext/commonmarker/cmark/FindAsan.cmake +74 -0
  11. data/ext/commonmarker/cmark/Makefile +170 -0
  12. data/ext/commonmarker/cmark/Makefile.nmake +36 -0
  13. data/ext/commonmarker/cmark/README.md +169 -0
  14. data/ext/commonmarker/cmark/api_test/CMakeLists.txt +25 -0
  15. data/ext/commonmarker/cmark/api_test/cplusplus.cpp +15 -0
  16. data/ext/commonmarker/cmark/api_test/cplusplus.h +17 -0
  17. data/ext/commonmarker/cmark/api_test/harness.c +102 -0
  18. data/ext/commonmarker/cmark/api_test/harness.h +42 -0
  19. data/ext/commonmarker/cmark/api_test/main.c +700 -0
  20. data/ext/commonmarker/cmark/appveyor.yml +15 -0
  21. data/ext/commonmarker/cmark/bench/statistics.py +595 -0
  22. data/ext/commonmarker/cmark/bench/stats.py +19 -0
  23. data/ext/commonmarker/cmark/benchmarks.md +33 -0
  24. data/ext/commonmarker/cmark/build/CMakeCache.txt +362 -0
  25. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCCompiler.cmake +63 -0
  26. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCXXCompiler.cmake +64 -0
  27. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_C.bin +0 -0
  28. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
  29. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeSystem.cmake +15 -0
  30. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c +499 -0
  31. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/a.out +0 -0
  32. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +489 -0
  33. data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out +0 -0
  34. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  35. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeError.log +30 -0
  36. data/ext/commonmarker/cmark/build/CMakeFiles/CMakeOutput.log +598 -0
  37. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile.cmake +77 -0
  38. data/ext/commonmarker/cmark/build/CMakeFiles/Makefile2 +268 -0
  39. data/ext/commonmarker/cmark/build/CMakeFiles/TargetDirectories.txt +4 -0
  40. data/ext/commonmarker/cmark/build/CMakeFiles/cmake.check_cache +1 -0
  41. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.bin +0 -0
  42. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.c +34 -0
  43. data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.cxx +405 -0
  44. data/ext/commonmarker/cmark/build/CMakeFiles/progress.marks +1 -0
  45. data/ext/commonmarker/cmark/build/CTestTestfile.cmake +10 -0
  46. data/ext/commonmarker/cmark/build/Makefile +237 -0
  47. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  48. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/C.includecache +92 -0
  49. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +36 -0
  50. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +29 -0
  51. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/build.make +155 -0
  52. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +12 -0
  53. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
  54. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.internal +25 -0
  55. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.make +25 -0
  56. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/flags.make +13 -0
  57. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
  58. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/link.txt +1 -0
  59. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
  60. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/progress.make +4 -0
  61. data/ext/commonmarker/cmark/build/api_test/CMakeFiles/progress.marks +1 -0
  62. data/ext/commonmarker/cmark/build/api_test/Makefile +277 -0
  63. data/ext/commonmarker/cmark/build/api_test/api_test +0 -0
  64. data/ext/commonmarker/cmark/build/api_test/cmake_install.cmake +29 -0
  65. data/ext/commonmarker/cmark/build/cmake_install.cmake +48 -0
  66. data/ext/commonmarker/cmark/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  67. data/ext/commonmarker/cmark/build/man/CMakeFiles/progress.marks +1 -0
  68. data/ext/commonmarker/cmark/build/man/Makefile +181 -0
  69. data/ext/commonmarker/cmark/build/man/cmake_install.cmake +37 -0
  70. data/ext/commonmarker/cmark/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  71. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/C.includecache +422 -0
  72. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/DependInfo.cmake +39 -0
  73. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/blocks.c.o +0 -0
  74. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/buffer.c.o +0 -0
  75. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/build.make +544 -0
  76. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmake_clean.cmake +27 -0
  77. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark.c.o +0 -0
  78. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark_ctype.c.o +0 -0
  79. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/commonmark.c.o +0 -0
  80. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.internal +177 -0
  81. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.make +177 -0
  82. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/flags.make +8 -0
  83. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_href_e.c.o +0 -0
  84. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_e.c.o +0 -0
  85. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_u.c.o +0 -0
  86. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/html.c.o +0 -0
  87. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/inlines.c.o +0 -0
  88. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/iterator.c.o +0 -0
  89. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/link.txt +1 -0
  90. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/main.c.o +0 -0
  91. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/man.c.o +0 -0
  92. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/node.c.o +0 -0
  93. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/progress.make +19 -0
  94. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/references.c.o +0 -0
  95. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/scanners.c.o +0 -0
  96. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/utf8.c.o +0 -0
  97. data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/xml.c.o +0 -0
  98. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/C.includecache +394 -0
  99. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/DependInfo.cmake +44 -0
  100. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/blocks.c.o +0 -0
  101. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/buffer.c.o +0 -0
  102. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/build.make +522 -0
  103. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmake_clean.cmake +27 -0
  104. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark.c.o +0 -0
  105. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark_ctype.c.o +0 -0
  106. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/commonmark.c.o +0 -0
  107. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.internal +169 -0
  108. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.make +169 -0
  109. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/flags.make +8 -0
  110. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_href_e.c.o +0 -0
  111. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_e.c.o +0 -0
  112. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_u.c.o +0 -0
  113. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/html.c.o +0 -0
  114. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/inlines.c.o +0 -0
  115. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/iterator.c.o +0 -0
  116. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/link.txt +1 -0
  117. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/man.c.o +0 -0
  118. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/node.c.o +0 -0
  119. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/progress.make +18 -0
  120. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/references.c.o +0 -0
  121. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/scanners.c.o +0 -0
  122. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/utf8.c.o +0 -0
  123. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/xml.c.o +0 -0
  124. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/C.includecache +394 -0
  125. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/DependInfo.cmake +38 -0
  126. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/blocks.c.o +0 -0
  127. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/buffer.c.o +0 -0
  128. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/build.make +519 -0
  129. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean.cmake +26 -0
  130. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean_target.cmake +3 -0
  131. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark.c.o +0 -0
  132. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark_ctype.c.o +0 -0
  133. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/commonmark.c.o +0 -0
  134. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.internal +169 -0
  135. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.make +169 -0
  136. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/flags.make +8 -0
  137. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_href_e.c.o +0 -0
  138. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_e.c.o +0 -0
  139. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_u.c.o +0 -0
  140. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/html.c.o +0 -0
  141. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/inlines.c.o +0 -0
  142. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/iterator.c.o +0 -0
  143. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/link.txt +2 -0
  144. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/man.c.o +0 -0
  145. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/node.c.o +0 -0
  146. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/progress.make +18 -0
  147. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/references.c.o +0 -0
  148. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/scanners.c.o +0 -0
  149. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/utf8.c.o +0 -0
  150. data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/xml.c.o +0 -0
  151. data/ext/commonmarker/cmark/build/src/CMakeFiles/progress.marks +1 -0
  152. data/ext/commonmarker/cmark/build/src/Makefile +814 -0
  153. data/ext/commonmarker/cmark/build/src/cmake_install.cmake +69 -0
  154. data/ext/commonmarker/cmark/build/src/cmark +0 -0
  155. data/ext/commonmarker/cmark/build/src/cmark_export.h +41 -0
  156. data/ext/commonmarker/cmark/build/src/cmark_version.h +7 -0
  157. data/ext/commonmarker/cmark/build/src/config.h +23 -0
  158. data/ext/commonmarker/cmark/build/src/libcmark.0.19.0.dylib +0 -0
  159. data/ext/commonmarker/cmark/build/src/libcmark.a +0 -0
  160. data/ext/commonmarker/cmark/build/src/libcmark.dylib +0 -0
  161. data/ext/commonmarker/cmark/build/src/libcmark.pc +10 -0
  162. data/ext/commonmarker/cmark/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  163. data/ext/commonmarker/cmark/build/testdir/CMakeFiles/progress.marks +1 -0
  164. data/ext/commonmarker/cmark/build/testdir/CTestTestfile.cmake +12 -0
  165. data/ext/commonmarker/cmark/build/testdir/Makefile +181 -0
  166. data/ext/commonmarker/cmark/build/testdir/cmake_install.cmake +29 -0
  167. data/ext/commonmarker/cmark/changelog.txt +153 -0
  168. data/ext/commonmarker/cmark/data/CaseFolding-3.2.0.txt +912 -0
  169. data/ext/commonmarker/cmark/man/CMakeLists.txt +8 -0
  170. data/ext/commonmarker/cmark/man/make_man_page.py +131 -0
  171. data/ext/commonmarker/cmark/man/man1/cmark.1 +54 -0
  172. data/ext/commonmarker/cmark/man/man3/cmark.3 +583 -0
  173. data/ext/commonmarker/cmark/nmake.bat +1 -0
  174. data/ext/commonmarker/cmark/src/CMakeLists.txt +166 -0
  175. data/ext/commonmarker/cmark/src/bench.h +27 -0
  176. data/ext/commonmarker/cmark/src/blocks.c +887 -0
  177. data/ext/commonmarker/cmark/src/buffer.c +381 -0
  178. data/ext/commonmarker/cmark/src/buffer.h +113 -0
  179. data/ext/commonmarker/cmark/src/case_fold_switch.inc +2637 -0
  180. data/ext/commonmarker/cmark/src/chunk.h +110 -0
  181. data/ext/commonmarker/cmark/src/cmark.c +24 -0
  182. data/ext/commonmarker/cmark/src/cmark.h +565 -0
  183. data/ext/commonmarker/cmark/src/cmark_ctype.c +53 -0
  184. data/ext/commonmarker/cmark/src/cmark_ctype.h +24 -0
  185. data/ext/commonmarker/cmark/src/cmark_version.h.in +7 -0
  186. data/ext/commonmarker/cmark/src/commonmark.c +607 -0
  187. data/ext/commonmarker/cmark/src/config.h.in +23 -0
  188. data/ext/commonmarker/cmark/src/debug.h +36 -0
  189. data/ext/commonmarker/cmark/src/houdini.h +52 -0
  190. data/ext/commonmarker/cmark/src/houdini_href_e.c +107 -0
  191. data/ext/commonmarker/cmark/src/houdini_html_e.c +81 -0
  192. data/ext/commonmarker/cmark/src/houdini_html_u.c +116 -0
  193. data/ext/commonmarker/cmark/src/html.c +322 -0
  194. data/ext/commonmarker/cmark/src/html_unescape.gperf +2130 -0
  195. data/ext/commonmarker/cmark/src/html_unescape.h +13375 -0
  196. data/ext/commonmarker/cmark/src/inlines.c +1147 -0
  197. data/ext/commonmarker/cmark/src/inlines.h +19 -0
  198. data/ext/commonmarker/cmark/src/iterator.c +148 -0
  199. data/ext/commonmarker/cmark/src/iterator.h +25 -0
  200. data/ext/commonmarker/cmark/src/libcmark.pc.in +10 -0
  201. data/ext/commonmarker/cmark/src/main.c +191 -0
  202. data/ext/commonmarker/cmark/src/man.c +287 -0
  203. data/ext/commonmarker/cmark/src/node.c +873 -0
  204. data/ext/commonmarker/cmark/src/node.h +82 -0
  205. data/ext/commonmarker/cmark/src/parser.h +29 -0
  206. data/ext/commonmarker/cmark/src/references.c +154 -0
  207. data/ext/commonmarker/cmark/src/references.h +37 -0
  208. data/ext/commonmarker/cmark/src/scanners.c +15291 -0
  209. data/ext/commonmarker/cmark/src/scanners.h +41 -0
  210. data/ext/commonmarker/cmark/src/scanners.re +247 -0
  211. data/ext/commonmarker/cmark/src/utf8.c +452 -0
  212. data/ext/commonmarker/cmark/src/utf8.h +22 -0
  213. data/ext/commonmarker/cmark/src/xml.c +170 -0
  214. data/ext/commonmarker/cmark/test/CMakeLists.txt +53 -0
  215. data/ext/commonmarker/cmark/test/afl_dictionary/asterisk +1 -0
  216. data/ext/commonmarker/cmark/test/afl_dictionary/attr_generic +1 -0
  217. data/ext/commonmarker/cmark/test/afl_dictionary/attr_href +1 -0
  218. data/ext/commonmarker/cmark/test/afl_dictionary/attr_xml_lang +1 -0
  219. data/ext/commonmarker/cmark/test/afl_dictionary/attr_xmlns +1 -0
  220. data/ext/commonmarker/cmark/test/afl_dictionary/backslash +1 -0
  221. data/ext/commonmarker/cmark/test/afl_dictionary/backtick +1 -0
  222. data/ext/commonmarker/cmark/test/afl_dictionary/colon +1 -0
  223. data/ext/commonmarker/cmark/test/afl_dictionary/dashes +1 -0
  224. data/ext/commonmarker/cmark/test/afl_dictionary/double_quote +1 -0
  225. data/ext/commonmarker/cmark/test/afl_dictionary/entity_builtin +1 -0
  226. data/ext/commonmarker/cmark/test/afl_dictionary/entity_decimal +1 -0
  227. data/ext/commonmarker/cmark/test/afl_dictionary/entity_external +1 -0
  228. data/ext/commonmarker/cmark/test/afl_dictionary/entity_hex +1 -0
  229. data/ext/commonmarker/cmark/test/afl_dictionary/equals +1 -0
  230. data/ext/commonmarker/cmark/test/afl_dictionary/exclamation +1 -0
  231. data/ext/commonmarker/cmark/test/afl_dictionary/greater_than +1 -0
  232. data/ext/commonmarker/cmark/test/afl_dictionary/hash +1 -0
  233. data/ext/commonmarker/cmark/test/afl_dictionary/hyphen +0 -0
  234. data/ext/commonmarker/cmark/test/afl_dictionary/indent +1 -0
  235. data/ext/commonmarker/cmark/test/afl_dictionary/left_bracket +1 -0
  236. data/ext/commonmarker/cmark/test/afl_dictionary/left_paren +1 -0
  237. data/ext/commonmarker/cmark/test/afl_dictionary/less_than +1 -0
  238. data/ext/commonmarker/cmark/test/afl_dictionary/plus +1 -0
  239. data/ext/commonmarker/cmark/test/afl_dictionary/right_bracket +1 -0
  240. data/ext/commonmarker/cmark/test/afl_dictionary/right_paren +1 -0
  241. data/ext/commonmarker/cmark/test/afl_dictionary/single_quote +1 -0
  242. data/ext/commonmarker/cmark/test/afl_dictionary/string_any +1 -0
  243. data/ext/commonmarker/cmark/test/afl_dictionary/string_brackets +1 -0
  244. data/ext/commonmarker/cmark/test/afl_dictionary/string_cdata +1 -0
  245. data/ext/commonmarker/cmark/test/afl_dictionary/string_dashes +1 -0
  246. data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_dblquotes +1 -0
  247. data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_quotes +1 -0
  248. data/ext/commonmarker/cmark/test/afl_dictionary/string_idrefs +1 -0
  249. data/ext/commonmarker/cmark/test/afl_dictionary/string_parentheses +1 -0
  250. data/ext/commonmarker/cmark/test/afl_dictionary/string_pcdata +1 -0
  251. data/ext/commonmarker/cmark/test/afl_dictionary/tag_cdata +1 -0
  252. data/ext/commonmarker/cmark/test/afl_dictionary/tag_close +1 -0
  253. data/ext/commonmarker/cmark/test/afl_dictionary/tag_doctype +1 -0
  254. data/ext/commonmarker/cmark/test/afl_dictionary/tag_element +1 -0
  255. data/ext/commonmarker/cmark/test/afl_dictionary/tag_entity +1 -0
  256. data/ext/commonmarker/cmark/test/afl_dictionary/tag_notation +1 -0
  257. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open +1 -0
  258. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_close +1 -0
  259. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_exclamation +1 -0
  260. data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_q +1 -0
  261. data/ext/commonmarker/cmark/test/afl_dictionary/tag_sq2_close +1 -0
  262. data/ext/commonmarker/cmark/test/afl_dictionary/tag_xml_q +1 -0
  263. data/ext/commonmarker/cmark/test/afl_dictionary/underscore +1 -0
  264. data/ext/commonmarker/cmark/test/afl_test_cases/test.md +36 -0
  265. data/ext/commonmarker/cmark/test/cmark.py +40 -0
  266. data/ext/commonmarker/cmark/test/normalize.py +179 -0
  267. data/ext/commonmarker/cmark/test/pathological_tests.py +63 -0
  268. data/ext/commonmarker/cmark/test/roundtrip.sh +2 -0
  269. data/ext/commonmarker/cmark/test/smart_punct.txt +96 -0
  270. data/ext/commonmarker/cmark/test/spec.txt +7505 -0
  271. data/ext/commonmarker/cmark/test/spec_tests.py +139 -0
  272. data/ext/commonmarker/cmark/toolchain-mingw32.cmake +17 -0
  273. data/ext/commonmarker/cmark/tools/mkcasefold.pl +22 -0
  274. data/ext/commonmarker/cmark/wrappers/wrapper.lua +239 -0
  275. data/ext/commonmarker/cmark/wrappers/wrapper.py +37 -0
  276. data/ext/commonmarker/cmark/wrappers/wrapper.rb +15 -0
  277. data/ext/commonmarker/cmark/wrappers/wrapper.rkt +190 -0
  278. data/ext/commonmarker/commonmarker.c +165 -0
  279. data/ext/commonmarker/commonmarker.h +11 -0
  280. data/ext/commonmarker/extconf.rb +18 -0
  281. data/lib/commonmarker/config.rb +20 -0
  282. data/lib/commonmarker/version.rb +3 -0
  283. data/lib/commonmarker.rb +588 -0
  284. data/test/benchmark.rb +30 -0
  285. data/test/spec_tests.json +4074 -0
  286. data/test/test_basics.rb +44 -0
  287. data/test/test_helper.rb +5 -0
  288. data/test/test_maliciousness.rb +9 -0
  289. data/test/test_pathological_inputs.rb +52 -0
  290. data/test/test_spec.rb +20 -0
  291. metadata +399 -0
File without changes
@@ -0,0 +1 @@
1
+ <![CDATA[
@@ -0,0 +1,36 @@
1
+ # H1
2
+
3
+ H2
4
+ --
5
+
6
+ t ☺
7
+ *b* **em** `c`
8
+ &ge;\&\
9
+ \_e\_
10
+
11
+ 4) I1
12
+
13
+ 5) I2
14
+ > [l](/u "t")
15
+ >
16
+ > - [f]
17
+ > - ![a](/u "t")
18
+ >
19
+ >> <ftp://hh>
20
+ >> <u@hh>
21
+
22
+ ~~~ l☺
23
+ cb
24
+ ~~~
25
+
26
+ c1
27
+ c2
28
+
29
+ ***
30
+
31
+ <div>
32
+ <b>x</b>
33
+ </div>
34
+
35
+ [f]: /u "t"
36
+
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ from ctypes import CDLL, c_char_p, c_long
5
+ from subprocess import *
6
+ import platform
7
+ import os
8
+
9
+ def pipe_through_prog(prog, text):
10
+ p1 = Popen(prog.split(), stdout=PIPE, stdin=PIPE, stderr=PIPE)
11
+ [result, err] = p1.communicate(input=text.encode('utf-8'))
12
+ return [p1.returncode, result.decode('utf-8'), err]
13
+
14
+ def use_library(lib, text):
15
+ textbytes = text.encode('utf-8')
16
+ textlen = len(textbytes)
17
+ return [0, lib(textbytes, textlen, 0).decode('utf-8'), '']
18
+
19
+ class CMark:
20
+ def __init__(self, prog=None, library_dir=None):
21
+ self.prog = prog
22
+ if prog:
23
+ self.to_html = lambda x: pipe_through_prog(prog, x)
24
+ else:
25
+ sysname = platform.system()
26
+ if sysname == 'Darwin':
27
+ libname = "libcmark.dylib"
28
+ elif sysname == 'Windows':
29
+ libname = "cmark.dll"
30
+ else:
31
+ libname = "libcmark.so"
32
+ if library_dir:
33
+ libpath = os.path.join(library_dir, libname)
34
+ else:
35
+ libpath = os.path.join("build", "src", libname)
36
+ cmark = CDLL(libpath)
37
+ markdown = cmark.cmark_markdown_to_html
38
+ markdown.restype = c_char_p
39
+ markdown.argtypes = [c_char_p, c_long]
40
+ self.to_html = lambda x: use_library(markdown, x)
@@ -0,0 +1,179 @@
1
+ # -*- coding: utf-8 -*-
2
+ from html.parser import HTMLParser, HTMLParseError
3
+ from html.entities import name2codepoint
4
+ import sys
5
+ import re
6
+ import cgi
7
+
8
+ # Normalization code, adapted from
9
+ # https://github.com/karlcow/markdown-testsuite/
10
+ significant_attrs = ["alt", "href", "src", "title"]
11
+ whitespace_re = re.compile('\s+')
12
+ class MyHTMLParser(HTMLParser):
13
+ def __init__(self):
14
+ HTMLParser.__init__(self)
15
+ self.last = "starttag"
16
+ self.in_pre = False
17
+ self.output = ""
18
+ self.last_tag = ""
19
+ def handle_data(self, data):
20
+ after_tag = self.last == "endtag" or self.last == "starttag"
21
+ after_block_tag = after_tag and self.is_block_tag(self.last_tag)
22
+ if after_tag and self.last_tag == "br":
23
+ data = data.lstrip('\n')
24
+ data = whitespace_re.sub(' ', data)
25
+ if after_block_tag and not self.in_pre:
26
+ if self.last == "starttag":
27
+ data = data.lstrip()
28
+ elif self.last == "endtag":
29
+ data = data.strip()
30
+ self.output += data
31
+ self.last = "data"
32
+ def handle_endtag(self, tag):
33
+ if tag == "pre":
34
+ self.in_pre = False
35
+ elif self.is_block_tag(tag):
36
+ self.output = self.output.rstrip()
37
+ self.output += "</" + tag + ">"
38
+ self.last_tag = tag
39
+ self.last = "endtag"
40
+ def handle_starttag(self, tag, attrs):
41
+ if tag == "pre":
42
+ self.in_pre = True
43
+ if self.is_block_tag(tag):
44
+ self.output = self.output.rstrip()
45
+ self.output += "<" + tag
46
+ # For now we don't strip out 'extra' attributes, because of
47
+ # raw HTML test cases.
48
+ # attrs = filter(lambda attr: attr[0] in significant_attrs, attrs)
49
+ if attrs:
50
+ attrs.sort()
51
+ for (k,v) in attrs:
52
+ self.output += " " + k
53
+ if v != None:
54
+ self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
55
+ self.output += ">"
56
+ self.last_tag = tag
57
+ self.last = "starttag"
58
+ def handle_startendtag(self, tag, attrs):
59
+ """Ignore closing tag for self-closing """
60
+ self.handle_starttag(tag, attrs)
61
+ self.last_tag = tag
62
+ self.last = "endtag"
63
+ def handle_comment(self, data):
64
+ self.output += '<!--' + data + '-->'
65
+ self.last = "comment"
66
+ def handle_decl(self, data):
67
+ self.output += '<!' + data + '>'
68
+ self.last = "decl"
69
+ def unknown_decl(self, data):
70
+ self.output += '<!' + data + '>'
71
+ self.last = "decl"
72
+ def handle_pi(self,data):
73
+ self.output += '<?' + data + '>'
74
+ self.last = "pi"
75
+ def handle_entityref(self, name):
76
+ try:
77
+ c = chr(name2codepoint[name])
78
+ except KeyError:
79
+ c = None
80
+ self.output_char(c, '&' + name + ';')
81
+ self.last = "ref"
82
+ def handle_charref(self, name):
83
+ try:
84
+ if name.startswith("x"):
85
+ c = chr(int(name[1:], 16))
86
+ else:
87
+ c = chr(int(name))
88
+ except ValueError:
89
+ c = None
90
+ self.output_char(c, '&' + name + ';')
91
+ self.last = "ref"
92
+ # Helpers.
93
+ def output_char(self, c, fallback):
94
+ if c == '<':
95
+ self.output += "&lt;"
96
+ elif c == '>':
97
+ self.output += "&gt;"
98
+ elif c == '&':
99
+ self.output += "&amp;"
100
+ elif c == '"':
101
+ self.output += "&quot;"
102
+ elif c == None:
103
+ self.output += fallback
104
+ else:
105
+ self.output += c
106
+
107
+ def is_block_tag(self,tag):
108
+ return (tag in ['article', 'header', 'aside', 'hgroup', 'blockquote',
109
+ 'hr', 'iframe', 'body', 'li', 'map', 'button', 'object', 'canvas',
110
+ 'ol', 'caption', 'output', 'col', 'p', 'colgroup', 'pre', 'dd',
111
+ 'progress', 'div', 'section', 'dl', 'table', 'td', 'dt',
112
+ 'tbody', 'embed', 'textarea', 'fieldset', 'tfoot', 'figcaption',
113
+ 'th', 'figure', 'thead', 'footer', 'tr', 'form', 'ul',
114
+ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'video', 'script', 'style'])
115
+
116
+ def normalize_html(html):
117
+ r"""
118
+ Return normalized form of HTML which ignores insignificant output
119
+ differences:
120
+
121
+ Multiple inner whitespaces are collapsed to a single space (except
122
+ in pre tags):
123
+
124
+ >>> normalize_html("<p>a \t b</p>")
125
+ '<p>a b</p>'
126
+
127
+ >>> normalize_html("<p>a \t\nb</p>")
128
+ '<p>a b</p>'
129
+
130
+ * Whitespace surrounding block-level tags is removed.
131
+
132
+ >>> normalize_html("<p>a b</p>")
133
+ '<p>a b</p>'
134
+
135
+ >>> normalize_html(" <p>a b</p>")
136
+ '<p>a b</p>'
137
+
138
+ >>> normalize_html("<p>a b</p> ")
139
+ '<p>a b</p>'
140
+
141
+ >>> normalize_html("\n\t<p>\n\t\ta b\t\t</p>\n\t")
142
+ '<p>a b</p>'
143
+
144
+ >>> normalize_html("<i>a b</i> ")
145
+ '<i>a b</i> '
146
+
147
+ * Self-closing tags are converted to open tags.
148
+
149
+ >>> normalize_html("<br />")
150
+ '<br>'
151
+
152
+ * Attributes are sorted and lowercased.
153
+
154
+ >>> normalize_html('<a title="bar" HREF="foo">x</a>')
155
+ '<a href="foo" title="bar">x</a>'
156
+
157
+ * References are converted to unicode, except that '<', '>', '&', and
158
+ '"' are rendered using entities.
159
+
160
+ >>> normalize_html("&forall;&amp;&gt;&lt;&quot;")
161
+ '\u2200&amp;&gt;&lt;&quot;'
162
+
163
+ """
164
+ html_chunk_re = re.compile("(\<!\[CDATA\[.*?\]\]\>|\<[^>]*\>|[^<]+)")
165
+ try:
166
+ parser = MyHTMLParser()
167
+ # We work around HTMLParser's limitations parsing CDATA
168
+ # by breaking the input into chunks and passing CDATA chunks
169
+ # through verbatim.
170
+ for chunk in re.finditer(html_chunk_re, html):
171
+ if chunk.group(0)[:8] == "<![CDATA":
172
+ parser.output += chunk.group(0)
173
+ else:
174
+ parser.feed(chunk.group(0))
175
+ parser.close()
176
+ return parser.output
177
+ except HTMLParseError as e:
178
+ sys.stderr.write("Normalization error: " + e.msg + "\n")
179
+ return html # on error, return unnormalized HTML
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ import re
5
+ import argparse
6
+ import sys
7
+ import platform
8
+ from cmark import CMark
9
+
10
+ if __name__ == "__main__":
11
+ parser = argparse.ArgumentParser(description='Run cmark tests.')
12
+ parser.add_argument('--program', dest='program', nargs='?', default=None,
13
+ help='program to test')
14
+ parser.add_argument('--library-dir', dest='library_dir', nargs='?',
15
+ default=None, help='directory containing dynamic library')
16
+ args = parser.parse_args(sys.argv[1:])
17
+
18
+ cmark = CMark(prog=args.program, library_dir=args.library_dir)
19
+
20
+ # list of pairs consisting of input and a regex that must match the output.
21
+ pathological = {
22
+ # note - some pythons have limit of 65535 for {num-matches} in re.
23
+ "nested strong emph":
24
+ (("*a **a " * 65000) + "b" + (" a** a*" * 65000),
25
+ re.compile("(<em>a <strong>a ){65000}b( a</strong> a</em>){65000}")),
26
+ "nested brackets":
27
+ (("[" * 50000) + "a" + ("]" * 50000),
28
+ re.compile("\[{50000}a\]{50000}")),
29
+ "nested block quotes":
30
+ ((("> " * 50000) + "a"),
31
+ re.compile("(<blockquote>\n){50000}")),
32
+ "U+0000 in input":
33
+ ("abc\u0000de\u0000",
34
+ re.compile("abc\ufffd?de\ufffd?"))
35
+ }
36
+
37
+ whitespace_re = re.compile('/s+/')
38
+ passed = 0
39
+ errored = 0
40
+ failed = 0
41
+
42
+ print("Testing pathological cases:")
43
+ for description in pathological:
44
+ print(description)
45
+ (inp, regex) = pathological[description]
46
+ [rc, actual, err] = cmark.to_html(inp)
47
+ if rc != 0:
48
+ errored += 1
49
+ print(description)
50
+ print("program returned error code %d" % rc)
51
+ print(err)
52
+ elif regex.search(actual):
53
+ passed += 1
54
+ else:
55
+ print(description, 'failed')
56
+ print(repr(actual))
57
+ failed += 1
58
+
59
+ print("%d passed, %d failed, %d errored" % (passed, failed, errored))
60
+ if (failed == 0 and errored == 0):
61
+ exit(0)
62
+ else:
63
+ exit(1)
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ ./build/src/cmark -t commonmark | ./build/src/cmark
@@ -0,0 +1,96 @@
1
+ ## Smart punctuation
2
+
3
+ .
4
+ "Hello," said the spider.
5
+ "'Shelob' is my name."
6
+ .
7
+ <p>“Hello,” said the spider.
8
+ “‘Shelob’ is my name.”</p>
9
+ .
10
+
11
+ .
12
+ 'A', 'B', and 'C' are letters.
13
+ .
14
+ <p>‘A’, ‘B’, and ‘C’ are letters.</p>
15
+ .
16
+
17
+ .
18
+ 'Oak,' 'elm,' and 'beech' are names of trees.
19
+ So is 'pine.'
20
+ .
21
+ <p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees.
22
+ So is ‘pine.’</p>
23
+ .
24
+
25
+ .
26
+ 'He said, "I want to go."'
27
+ .
28
+ <p>‘He said, “I want to go.”’</p>
29
+ .
30
+
31
+ .
32
+ Were you alive in the 70's?
33
+ .
34
+ <p>Were you alive in the 70’s?</p>
35
+ .
36
+
37
+ .
38
+ Here is some quoted '`code`' and a "[quoted link](url)".
39
+ .
40
+ <p>Here is some quoted ‘<code>code</code>’ and a “<a href="url">quoted link</a>”.</p>
41
+ .
42
+
43
+ .
44
+ 'tis the season to be 'jolly'
45
+ .
46
+ <p>’tis the season to be ‘jolly’</p>
47
+ .
48
+
49
+ .
50
+ "A paragraph with no closing quote.
51
+
52
+ "Second paragraph by same speaker, in fiction."
53
+ .
54
+ <p>“A paragraph with no closing quote.</p>
55
+ <p>“Second paragraph by same speaker, in fiction.”</p>
56
+ .
57
+
58
+ .
59
+ \"This is not smart.\"
60
+ This isn\'t either.
61
+ .
62
+ <p>&quot;This is not smart.&quot;
63
+ This isn't either.</p>
64
+ .
65
+
66
+ .
67
+ Some dashes: one---two ---
68
+ three---four --- five.
69
+ .
70
+ <p>Some dashes: one—two —
71
+ three—four — five.</p>
72
+ .
73
+
74
+ .
75
+ Escaped dashes: \-- \-\-\-.
76
+ .
77
+ <p>Escaped dashes: -- ---.</p>
78
+ .
79
+
80
+ .
81
+ Dashes between numbers: 5--7, 255--66, 1987--1999.
82
+ .
83
+ <p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>
84
+ .
85
+
86
+ .
87
+ Ellipses...and...and....
88
+ .
89
+ <p>Ellipses…and…and….</p>
90
+ .
91
+
92
+ .
93
+ No ellipses\.\.\.
94
+ .
95
+ <p>No ellipses...</p>
96
+ .