commonmarker 0.17.6 → 0.17.7

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 (405) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -7
  3. data/ext/commonmarker/{cmark/src/arena.c → arena.c} +0 -0
  4. data/ext/commonmarker/{cmark/extensions/autolink.c → autolink.c} +0 -0
  5. data/ext/commonmarker/{cmark/extensions/autolink.h → autolink.h} +0 -0
  6. data/ext/commonmarker/{cmark/src/blocks.c → blocks.c} +0 -0
  7. data/ext/commonmarker/{cmark/src/buffer.c → buffer.c} +0 -0
  8. data/ext/commonmarker/{cmark/src/buffer.h → buffer.h} +0 -0
  9. data/ext/commonmarker/{cmark/src/case_fold_switch.inc → case_fold_switch.inc} +0 -0
  10. data/ext/commonmarker/{cmark/src/chunk.h → chunk.h} +0 -0
  11. data/ext/commonmarker/{cmark → cmark-upstream}/CMakeLists.txt +0 -0
  12. data/ext/commonmarker/{cmark → cmark-upstream}/COPYING +0 -0
  13. data/ext/commonmarker/{cmark → cmark-upstream}/FindAsan.cmake +0 -0
  14. data/ext/commonmarker/{cmark → cmark-upstream}/Makefile +0 -0
  15. data/ext/commonmarker/{cmark → cmark-upstream}/Makefile.nmake +0 -0
  16. data/ext/commonmarker/{cmark → cmark-upstream}/README.md +0 -0
  17. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/CMakeLists.txt +0 -0
  18. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/cplusplus.cpp +0 -0
  19. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/cplusplus.h +0 -0
  20. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/harness.c +0 -0
  21. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/harness.h +0 -0
  22. data/ext/commonmarker/{cmark → cmark-upstream}/api_test/main.c +0 -0
  23. data/ext/commonmarker/{cmark → cmark-upstream}/appveyor.yml +0 -0
  24. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-bq-flat.md +0 -0
  25. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-bq-nested.md +0 -0
  26. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-code.md +0 -0
  27. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-fences.md +0 -0
  28. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-heading.md +0 -0
  29. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-hr.md +0 -0
  30. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-html.md +0 -0
  31. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-lheading.md +0 -0
  32. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-list-flat.md +0 -0
  33. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-list-nested.md +0 -0
  34. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-ref-flat.md +0 -0
  35. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-ref-nested.md +0 -0
  36. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-autolink.md +0 -0
  37. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-backticks.md +0 -0
  38. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-flat.md +0 -0
  39. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-nested.md +0 -0
  40. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-worst.md +0 -0
  41. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-entity.md +0 -0
  42. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-escape.md +0 -0
  43. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-html.md +0 -0
  44. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-links-flat.md +0 -0
  45. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-links-nested.md +0 -0
  46. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-newlines.md +0 -0
  47. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/lorem1.md +0 -0
  48. data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/rawtabs.md +0 -0
  49. data/ext/commonmarker/{cmark → cmark-upstream}/bench/statistics.py +0 -0
  50. data/ext/commonmarker/{cmark → cmark-upstream}/bench/stats.py +0 -0
  51. data/ext/commonmarker/{cmark → cmark-upstream}/benchmarks.md +0 -0
  52. data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +478 -0
  53. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +71 -0
  54. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +73 -0
  55. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_C.bin +0 -0
  56. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_CXX.bin +0 -0
  57. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeSystem.cmake +15 -0
  58. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +567 -0
  59. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/a.out +0 -0
  60. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/CMakeCXXCompilerId.cpp +539 -0
  61. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
  62. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  63. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +18 -0
  64. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +709 -0
  65. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +157 -0
  66. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +391 -0
  67. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +48 -0
  68. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +1 -0
  69. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
  70. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +34 -0
  71. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +405 -0
  72. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +1 -0
  73. data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +11 -0
  74. data/ext/commonmarker/cmark-upstream/build/Makefile +280 -0
  75. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  76. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +134 -0
  77. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +38 -0
  78. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +38 -0
  79. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +169 -0
  80. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +12 -0
  81. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
  82. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.internal +28 -0
  83. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +28 -0
  84. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +17 -0
  85. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
  86. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/link.txt +1 -0
  87. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
  88. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/progress.make +5 -0
  89. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +1 -0
  90. data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +302 -0
  91. data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
  92. data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +29 -0
  93. data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +49 -0
  94. data/ext/commonmarker/cmark-upstream/build/compile_commands.json +352 -0
  95. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  96. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +30 -0
  97. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +108 -0
  98. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +246 -0
  99. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +36 -0
  100. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/autolink.c.o +0 -0
  101. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/build.make +253 -0
  102. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +16 -0
  103. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/core-extensions.c.o +0 -0
  104. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.internal +96 -0
  105. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +96 -0
  106. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/ext_scanners.c.o +0 -0
  107. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/flags.make +10 -0
  108. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +1 -0
  109. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +8 -0
  110. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/strikethrough.c.o +0 -0
  111. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/table.c.o +0 -0
  112. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/tagfilter.c.o +0 -0
  113. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/C.includecache +246 -0
  114. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +29 -0
  115. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/autolink.c.o +0 -0
  116. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/build.make +249 -0
  117. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +15 -0
  118. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +3 -0
  119. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/core-extensions.c.o +0 -0
  120. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.internal +96 -0
  121. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +96 -0
  122. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/ext_scanners.c.o +0 -0
  123. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/flags.make +10 -0
  124. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +2 -0
  125. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +8 -0
  126. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/strikethrough.c.o +0 -0
  127. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/table.c.o +0 -0
  128. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/tagfilter.c.o +0 -0
  129. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/progress.marks +1 -0
  130. data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +426 -0
  131. data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +84 -0
  132. data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +42 -0
  133. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.0.28.3.gfm.11.dylib +0 -0
  134. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.a +0 -0
  135. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.dylib +1 -0
  136. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  137. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +1 -0
  138. data/ext/commonmarker/cmark-upstream/build/man/Makefile +196 -0
  139. data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +37 -0
  140. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  141. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +38 -0
  142. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +95 -0
  143. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +156 -0
  144. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +30 -0
  145. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +115 -0
  146. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +10 -0
  147. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +20 -0
  148. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +20 -0
  149. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +10 -0
  150. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +1 -0
  151. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/main.c.o +0 -0
  152. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/progress.make +3 -0
  153. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +612 -0
  154. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +60 -0
  155. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/arena.c.o +0 -0
  156. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/blocks.c.o +0 -0
  157. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/buffer.c.o +0 -0
  158. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/build.make +819 -0
  159. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +37 -0
  160. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark.c.o +0 -0
  161. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark_ctype.c.o +0 -0
  162. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/commonmark.c.o +0 -0
  163. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.internal +319 -0
  164. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +319 -0
  165. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +10 -0
  166. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/footnotes.c.o +0 -0
  167. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_href_e.c.o +0 -0
  168. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_e.c.o +0 -0
  169. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_u.c.o +0 -0
  170. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/html.c.o +0 -0
  171. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/inlines.c.o +0 -0
  172. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/iterator.c.o +0 -0
  173. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/latex.c.o +0 -0
  174. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/link.txt +1 -0
  175. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/linked_list.c.o +0 -0
  176. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/man.c.o +0 -0
  177. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/map.c.o +0 -0
  178. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/node.c.o +0 -0
  179. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plaintext.c.o +0 -0
  180. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plugin.c.o +0 -0
  181. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/progress.make +29 -0
  182. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/references.c.o +0 -0
  183. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/registry.c.o +0 -0
  184. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/render.c.o +0 -0
  185. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/scanners.c.o +0 -0
  186. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/syntax_extension.c.o +0 -0
  187. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/utf8.c.o +0 -0
  188. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/xml.c.o +0 -0
  189. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/C.includecache +612 -0
  190. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +54 -0
  191. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/arena.c.o +0 -0
  192. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/blocks.c.o +0 -0
  193. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/buffer.c.o +0 -0
  194. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/build.make +816 -0
  195. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +36 -0
  196. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +3 -0
  197. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark.c.o +0 -0
  198. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark_ctype.c.o +0 -0
  199. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/commonmark.c.o +0 -0
  200. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.internal +319 -0
  201. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +319 -0
  202. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +10 -0
  203. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/footnotes.c.o +0 -0
  204. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_href_e.c.o +0 -0
  205. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_e.c.o +0 -0
  206. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_u.c.o +0 -0
  207. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/html.c.o +0 -0
  208. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/inlines.c.o +0 -0
  209. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/iterator.c.o +0 -0
  210. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/latex.c.o +0 -0
  211. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/link.txt +2 -0
  212. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/linked_list.c.o +0 -0
  213. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/man.c.o +0 -0
  214. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/map.c.o +0 -0
  215. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/node.c.o +0 -0
  216. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plaintext.c.o +0 -0
  217. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plugin.c.o +0 -0
  218. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/progress.make +29 -0
  219. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/references.c.o +0 -0
  220. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/registry.c.o +0 -0
  221. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/render.c.o +0 -0
  222. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/scanners.c.o +0 -0
  223. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/syntax_extension.c.o +0 -0
  224. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/utf8.c.o +0 -0
  225. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/xml.c.o +0 -0
  226. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/progress.marks +1 -0
  227. data/ext/commonmarker/cmark-upstream/build/src/Makefile +1165 -0
  228. data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +97 -0
  229. data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
  230. data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +42 -0
  231. data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +8 -0
  232. data/ext/commonmarker/cmark-upstream/build/src/config.h +76 -0
  233. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.0.28.3.gfm.11.dylib +0 -0
  234. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.a +0 -0
  235. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.dylib +1 -0
  236. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +10 -0
  237. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
  238. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +1 -0
  239. data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +17 -0
  240. data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +196 -0
  241. data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +29 -0
  242. data/ext/commonmarker/{cmark → cmark-upstream}/changelog.txt +0 -0
  243. data/ext/commonmarker/{cmark → cmark-upstream}/data/CaseFolding.txt +0 -0
  244. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/CMakeLists.txt +0 -0
  245. data/ext/commonmarker/cmark-upstream/extensions/autolink.c +421 -0
  246. data/ext/commonmarker/cmark-upstream/extensions/autolink.h +8 -0
  247. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/core-extensions.c +0 -0
  248. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/core-extensions.h +0 -0
  249. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.c +0 -0
  250. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.h +0 -0
  251. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.re +0 -0
  252. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/strikethrough.c +0 -0
  253. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/strikethrough.h +0 -0
  254. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/table.c +0 -0
  255. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/table.h +0 -0
  256. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/tagfilter.c +0 -0
  257. data/ext/commonmarker/{cmark → cmark-upstream}/extensions/tagfilter.h +0 -0
  258. data/ext/commonmarker/{cmark → cmark-upstream}/man/CMakeLists.txt +0 -0
  259. data/ext/commonmarker/{cmark → cmark-upstream}/man/make_man_page.py +0 -0
  260. data/ext/commonmarker/{cmark → cmark-upstream}/man/man1/cmark-gfm.1 +0 -0
  261. data/ext/commonmarker/{cmark → cmark-upstream}/man/man3/cmark-gfm.3 +0 -0
  262. data/ext/commonmarker/{cmark → cmark-upstream}/nmake.bat +0 -0
  263. data/ext/commonmarker/{cmark → cmark-upstream}/src/CMakeLists.txt +0 -0
  264. data/ext/commonmarker/cmark-upstream/src/arena.c +103 -0
  265. data/ext/commonmarker/cmark-upstream/src/blocks.c +1519 -0
  266. data/ext/commonmarker/cmark-upstream/src/buffer.c +279 -0
  267. data/ext/commonmarker/cmark-upstream/src/buffer.h +116 -0
  268. data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +4327 -0
  269. data/ext/commonmarker/cmark-upstream/src/chunk.h +136 -0
  270. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark.c +0 -0
  271. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark.h +0 -0
  272. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_ctype.c +0 -0
  273. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_ctype.h +0 -0
  274. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_extension_api.h +0 -0
  275. data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_version.h.in +0 -0
  276. data/ext/commonmarker/{cmark → cmark-upstream}/src/commonmark.c +0 -0
  277. data/ext/commonmarker/{cmark → cmark-upstream}/src/config.h.in +0 -0
  278. data/ext/commonmarker/{cmark → cmark-upstream}/src/entities.inc +0 -0
  279. data/ext/commonmarker/{cmark → cmark-upstream}/src/footnotes.c +0 -0
  280. data/ext/commonmarker/{cmark → cmark-upstream}/src/footnotes.h +0 -0
  281. data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini.h +0 -0
  282. data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_href_e.c +0 -0
  283. data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_html_e.c +0 -0
  284. data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_html_u.c +0 -0
  285. data/ext/commonmarker/{cmark → cmark-upstream}/src/html.c +0 -0
  286. data/ext/commonmarker/{cmark → cmark-upstream}/src/html.h +0 -0
  287. data/ext/commonmarker/{cmark → cmark-upstream}/src/inlines.c +8 -4
  288. data/ext/commonmarker/{cmark → cmark-upstream}/src/inlines.h +0 -0
  289. data/ext/commonmarker/{cmark → cmark-upstream}/src/iterator.c +0 -0
  290. data/ext/commonmarker/{cmark → cmark-upstream}/src/iterator.h +0 -0
  291. data/ext/commonmarker/{cmark → cmark-upstream}/src/latex.c +0 -0
  292. data/ext/commonmarker/{cmark → cmark-upstream}/src/libcmark-gfm.pc.in +0 -0
  293. data/ext/commonmarker/{cmark → cmark-upstream}/src/linked_list.c +0 -0
  294. data/ext/commonmarker/{cmark → cmark-upstream}/src/main.c +0 -0
  295. data/ext/commonmarker/{cmark → cmark-upstream}/src/man.c +0 -0
  296. data/ext/commonmarker/{cmark → cmark-upstream}/src/map.c +0 -0
  297. data/ext/commonmarker/{cmark → cmark-upstream}/src/map.h +0 -0
  298. data/ext/commonmarker/{cmark → cmark-upstream}/src/node.c +0 -0
  299. data/ext/commonmarker/{cmark → cmark-upstream}/src/node.h +0 -0
  300. data/ext/commonmarker/{cmark → cmark-upstream}/src/parser.h +0 -0
  301. data/ext/commonmarker/{cmark → cmark-upstream}/src/plaintext.c +0 -0
  302. data/ext/commonmarker/{cmark → cmark-upstream}/src/plugin.c +0 -0
  303. data/ext/commonmarker/{cmark → cmark-upstream}/src/plugin.h +0 -0
  304. data/ext/commonmarker/{cmark → cmark-upstream}/src/references.c +0 -0
  305. data/ext/commonmarker/{cmark → cmark-upstream}/src/references.h +0 -0
  306. data/ext/commonmarker/{cmark → cmark-upstream}/src/registry.c +0 -0
  307. data/ext/commonmarker/{cmark → cmark-upstream}/src/registry.h +0 -0
  308. data/ext/commonmarker/{cmark → cmark-upstream}/src/render.c +0 -0
  309. data/ext/commonmarker/{cmark → cmark-upstream}/src/render.h +0 -0
  310. data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.c +0 -0
  311. data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.h +0 -0
  312. data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.re +0 -0
  313. data/ext/commonmarker/{cmark → cmark-upstream}/src/syntax_extension.c +0 -0
  314. data/ext/commonmarker/{cmark → cmark-upstream}/src/syntax_extension.h +0 -0
  315. data/ext/commonmarker/{cmark → cmark-upstream}/src/utf8.c +0 -0
  316. data/ext/commonmarker/{cmark → cmark-upstream}/src/utf8.h +0 -0
  317. data/ext/commonmarker/{cmark → cmark-upstream}/src/xml.c +0 -0
  318. data/ext/commonmarker/{cmark → cmark-upstream}/suppressions +0 -0
  319. data/ext/commonmarker/{cmark → cmark-upstream}/test/CMakeLists.txt +0 -0
  320. data/ext/commonmarker/{cmark → cmark-upstream}/test/afl_test_cases/test.md +0 -0
  321. data/ext/commonmarker/{cmark → cmark-upstream}/test/cmark-fuzz.c +0 -0
  322. data/ext/commonmarker/{cmark → cmark-upstream}/test/cmark.py +0 -0
  323. data/ext/commonmarker/{cmark → cmark-upstream}/test/entity_tests.py +0 -0
  324. data/ext/commonmarker/{cmark → cmark-upstream}/test/extensions.txt +2 -2
  325. data/ext/commonmarker/{cmark → cmark-upstream}/test/fuzzing_dictionary +0 -0
  326. data/ext/commonmarker/{cmark → cmark-upstream}/test/normalize.py +0 -0
  327. data/ext/commonmarker/{cmark → cmark-upstream}/test/pathological_tests.py +0 -0
  328. data/ext/commonmarker/{cmark → cmark-upstream}/test/regression.txt +0 -0
  329. data/ext/commonmarker/{cmark → cmark-upstream}/test/roundtrip_tests.py +0 -0
  330. data/ext/commonmarker/{cmark → cmark-upstream}/test/run-cmark-fuzz +0 -0
  331. data/ext/commonmarker/{cmark → cmark-upstream}/test/smart_punct.txt +0 -0
  332. data/ext/commonmarker/{cmark → cmark-upstream}/test/spec.txt +0 -0
  333. data/ext/commonmarker/{cmark → cmark-upstream}/test/spec_tests.py +0 -0
  334. data/ext/commonmarker/{cmark → cmark-upstream}/toolchain-mingw32.cmake +0 -0
  335. data/ext/commonmarker/{cmark → cmark-upstream}/tools/Dockerfile +0 -0
  336. data/ext/commonmarker/{cmark → cmark-upstream}/tools/appveyor-build.bat +0 -0
  337. data/ext/commonmarker/{cmark → cmark-upstream}/tools/make_entities_inc.py +0 -0
  338. data/ext/commonmarker/{cmark → cmark-upstream}/tools/mkcasefold.pl +0 -0
  339. data/ext/commonmarker/{cmark → cmark-upstream}/why-cmark-and-not-x.md +0 -0
  340. data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.js +0 -0
  341. data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.py +0 -0
  342. data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.rb +0 -0
  343. data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.rkt +0 -0
  344. data/ext/commonmarker/cmark.c +55 -0
  345. data/ext/commonmarker/cmark.h +789 -0
  346. data/ext/commonmarker/cmark_ctype.c +44 -0
  347. data/ext/commonmarker/cmark_ctype.h +33 -0
  348. data/ext/commonmarker/cmark_export.h +42 -0
  349. data/ext/commonmarker/cmark_extension_api.h +719 -0
  350. data/ext/commonmarker/cmark_version.h +8 -0
  351. data/ext/commonmarker/cmarkextensions_export.h +42 -0
  352. data/ext/commonmarker/commonmark.c +508 -0
  353. data/ext/commonmarker/config.h +76 -0
  354. data/ext/commonmarker/core-extensions.c +25 -0
  355. data/ext/commonmarker/core-extensions.h +25 -0
  356. data/ext/commonmarker/entities.inc +2138 -0
  357. data/ext/commonmarker/ext_scanners.c +941 -0
  358. data/ext/commonmarker/ext_scanners.h +22 -0
  359. data/ext/commonmarker/extconf.rb +1 -48
  360. data/ext/commonmarker/footnotes.c +40 -0
  361. data/ext/commonmarker/footnotes.h +25 -0
  362. data/ext/commonmarker/houdini.h +57 -0
  363. data/ext/commonmarker/houdini_href_e.c +100 -0
  364. data/ext/commonmarker/houdini_html_e.c +66 -0
  365. data/ext/commonmarker/houdini_html_u.c +149 -0
  366. data/ext/commonmarker/html.c +457 -0
  367. data/ext/commonmarker/html.h +27 -0
  368. data/ext/commonmarker/inlines.c +1594 -0
  369. data/ext/commonmarker/inlines.h +29 -0
  370. data/ext/commonmarker/iterator.c +159 -0
  371. data/ext/commonmarker/iterator.h +27 -0
  372. data/ext/commonmarker/latex.c +466 -0
  373. data/ext/commonmarker/linked_list.c +37 -0
  374. data/ext/commonmarker/man.c +278 -0
  375. data/ext/commonmarker/map.c +122 -0
  376. data/ext/commonmarker/map.h +42 -0
  377. data/ext/commonmarker/node.c +965 -0
  378. data/ext/commonmarker/node.h +116 -0
  379. data/ext/commonmarker/parser.h +57 -0
  380. data/ext/commonmarker/plaintext.c +213 -0
  381. data/ext/commonmarker/plugin.c +36 -0
  382. data/ext/commonmarker/plugin.h +34 -0
  383. data/ext/commonmarker/references.c +42 -0
  384. data/ext/commonmarker/references.h +26 -0
  385. data/ext/commonmarker/registry.c +63 -0
  386. data/ext/commonmarker/registry.h +24 -0
  387. data/ext/commonmarker/render.c +202 -0
  388. data/ext/commonmarker/render.h +63 -0
  389. data/ext/commonmarker/scanners.c +18195 -0
  390. data/ext/commonmarker/scanners.h +64 -0
  391. data/ext/commonmarker/scanners.re +341 -0
  392. data/ext/commonmarker/strikethrough.c +157 -0
  393. data/ext/commonmarker/strikethrough.h +9 -0
  394. data/ext/commonmarker/syntax_extension.c +139 -0
  395. data/ext/commonmarker/syntax_extension.h +32 -0
  396. data/ext/commonmarker/table.c +683 -0
  397. data/ext/commonmarker/table.h +8 -0
  398. data/ext/commonmarker/tagfilter.c +60 -0
  399. data/ext/commonmarker/tagfilter.h +8 -0
  400. data/ext/commonmarker/utf8.c +317 -0
  401. data/ext/commonmarker/utf8.h +35 -0
  402. data/ext/commonmarker/xml.c +174 -0
  403. data/lib/commonmarker/version.rb +1 -1
  404. data/test/test_helper.rb +1 -1
  405. metadata +401 -145
@@ -0,0 +1,8 @@
1
+ #ifndef TABLE_H
2
+ #define TABLE_H
3
+
4
+ #include "core-extensions.h"
5
+
6
+ cmark_syntax_extension *create_table_extension(void);
7
+
8
+ #endif
@@ -0,0 +1,60 @@
1
+ #include "tagfilter.h"
2
+ #include <parser.h>
3
+ #include <ctype.h>
4
+
5
+ static const char *blacklist[] = {
6
+ "title", "textarea", "style", "xmp", "iframe",
7
+ "noembed", "noframes", "script", "plaintext", NULL,
8
+ };
9
+
10
+ static int is_tag(const unsigned char *tag_data, size_t tag_size,
11
+ const char *tagname) {
12
+ size_t i;
13
+
14
+ if (tag_size < 3 || tag_data[0] != '<')
15
+ return 0;
16
+
17
+ i = 1;
18
+
19
+ if (tag_data[i] == '/') {
20
+ i++;
21
+ }
22
+
23
+ for (; i < tag_size; ++i, ++tagname) {
24
+ if (*tagname == 0)
25
+ break;
26
+
27
+ if (tolower(tag_data[i]) != *tagname)
28
+ return 0;
29
+ }
30
+
31
+ if (i == tag_size)
32
+ return 0;
33
+
34
+ if (cmark_isspace(tag_data[i]) || tag_data[i] == '>')
35
+ return 1;
36
+
37
+ if (tag_data[i] == '/' && tag_size >= i + 2 && tag_data[i + 1] == '>')
38
+ return 1;
39
+
40
+ return 0;
41
+ }
42
+
43
+ static int filter(cmark_syntax_extension *ext, const unsigned char *tag,
44
+ size_t tag_len) {
45
+ const char **it;
46
+
47
+ for (it = blacklist; *it; ++it) {
48
+ if (is_tag(tag, tag_len, *it)) {
49
+ return 0;
50
+ }
51
+ }
52
+
53
+ return 1;
54
+ }
55
+
56
+ cmark_syntax_extension *create_tagfilter_extension(void) {
57
+ cmark_syntax_extension *ext = cmark_syntax_extension_new("tagfilter");
58
+ cmark_syntax_extension_set_html_filter_func(ext, filter);
59
+ return ext;
60
+ }
@@ -0,0 +1,8 @@
1
+ #ifndef TAGFILTER_H
2
+ #define TAGFILTER_H
3
+
4
+ #include "core-extensions.h"
5
+
6
+ cmark_syntax_extension *create_tagfilter_extension(void);
7
+
8
+ #endif
@@ -0,0 +1,317 @@
1
+ #include <stdlib.h>
2
+ #include <stdint.h>
3
+ #include <assert.h>
4
+
5
+ #include "cmark_ctype.h"
6
+ #include "utf8.h"
7
+
8
+ static const int8_t utf8proc_utf8class[256] = {
9
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
11
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
13
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
14
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
18
+ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
19
+ 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0};
20
+
21
+ static void encode_unknown(cmark_strbuf *buf) {
22
+ static const uint8_t repl[] = {239, 191, 189};
23
+ cmark_strbuf_put(buf, repl, 3);
24
+ }
25
+
26
+ static int utf8proc_charlen(const uint8_t *str, bufsize_t str_len) {
27
+ int length, i;
28
+
29
+ if (!str_len)
30
+ return 0;
31
+
32
+ length = utf8proc_utf8class[str[0]];
33
+
34
+ if (!length)
35
+ return -1;
36
+
37
+ if (str_len >= 0 && (bufsize_t)length > str_len)
38
+ return -str_len;
39
+
40
+ for (i = 1; i < length; i++) {
41
+ if ((str[i] & 0xC0) != 0x80)
42
+ return -i;
43
+ }
44
+
45
+ return length;
46
+ }
47
+
48
+ // Validate a single UTF-8 character according to RFC 3629.
49
+ static int utf8proc_valid(const uint8_t *str, bufsize_t str_len) {
50
+ int length = utf8proc_utf8class[str[0]];
51
+
52
+ if (!length)
53
+ return -1;
54
+
55
+ if ((bufsize_t)length > str_len)
56
+ return -str_len;
57
+
58
+ switch (length) {
59
+ case 2:
60
+ if ((str[1] & 0xC0) != 0x80)
61
+ return -1;
62
+ if (str[0] < 0xC2) {
63
+ // Overlong
64
+ return -length;
65
+ }
66
+ break;
67
+
68
+ case 3:
69
+ if ((str[1] & 0xC0) != 0x80)
70
+ return -1;
71
+ if ((str[2] & 0xC0) != 0x80)
72
+ return -2;
73
+ if (str[0] == 0xE0) {
74
+ if (str[1] < 0xA0) {
75
+ // Overlong
76
+ return -length;
77
+ }
78
+ } else if (str[0] == 0xED) {
79
+ if (str[1] >= 0xA0) {
80
+ // Surrogate
81
+ return -length;
82
+ }
83
+ }
84
+ break;
85
+
86
+ case 4:
87
+ if ((str[1] & 0xC0) != 0x80)
88
+ return -1;
89
+ if ((str[2] & 0xC0) != 0x80)
90
+ return -2;
91
+ if ((str[3] & 0xC0) != 0x80)
92
+ return -3;
93
+ if (str[0] == 0xF0) {
94
+ if (str[1] < 0x90) {
95
+ // Overlong
96
+ return -length;
97
+ }
98
+ } else if (str[0] >= 0xF4) {
99
+ if (str[0] > 0xF4 || str[1] >= 0x90) {
100
+ // Above 0x10FFFF
101
+ return -length;
102
+ }
103
+ }
104
+ break;
105
+ }
106
+
107
+ return length;
108
+ }
109
+
110
+ void cmark_utf8proc_check(cmark_strbuf *ob, const uint8_t *line,
111
+ bufsize_t size) {
112
+ bufsize_t i = 0;
113
+
114
+ while (i < size) {
115
+ bufsize_t org = i;
116
+ int charlen = 0;
117
+
118
+ while (i < size) {
119
+ if (line[i] < 0x80 && line[i] != 0) {
120
+ i++;
121
+ } else if (line[i] >= 0x80) {
122
+ charlen = utf8proc_valid(line + i, size - i);
123
+ if (charlen < 0) {
124
+ charlen = -charlen;
125
+ break;
126
+ }
127
+ i += charlen;
128
+ } else if (line[i] == 0) {
129
+ // ASCII NUL is technically valid but rejected
130
+ // for security reasons.
131
+ charlen = 1;
132
+ break;
133
+ }
134
+ }
135
+
136
+ if (i > org) {
137
+ cmark_strbuf_put(ob, line + org, i - org);
138
+ }
139
+
140
+ if (i >= size) {
141
+ break;
142
+ } else {
143
+ // Invalid UTF-8
144
+ encode_unknown(ob);
145
+ i += charlen;
146
+ }
147
+ }
148
+ }
149
+
150
+ int cmark_utf8proc_iterate(const uint8_t *str, bufsize_t str_len,
151
+ int32_t *dst) {
152
+ int length;
153
+ int32_t uc = -1;
154
+
155
+ *dst = -1;
156
+ length = utf8proc_charlen(str, str_len);
157
+ if (length < 0)
158
+ return -1;
159
+
160
+ switch (length) {
161
+ case 1:
162
+ uc = str[0];
163
+ break;
164
+ case 2:
165
+ uc = ((str[0] & 0x1F) << 6) + (str[1] & 0x3F);
166
+ if (uc < 0x80)
167
+ uc = -1;
168
+ break;
169
+ case 3:
170
+ uc = ((str[0] & 0x0F) << 12) + ((str[1] & 0x3F) << 6) + (str[2] & 0x3F);
171
+ if (uc < 0x800 || (uc >= 0xD800 && uc < 0xE000))
172
+ uc = -1;
173
+ break;
174
+ case 4:
175
+ uc = ((str[0] & 0x07) << 18) + ((str[1] & 0x3F) << 12) +
176
+ ((str[2] & 0x3F) << 6) + (str[3] & 0x3F);
177
+ if (uc < 0x10000 || uc >= 0x110000)
178
+ uc = -1;
179
+ break;
180
+ }
181
+
182
+ if (uc < 0)
183
+ return -1;
184
+
185
+ *dst = uc;
186
+ return length;
187
+ }
188
+
189
+ void cmark_utf8proc_encode_char(int32_t uc, cmark_strbuf *buf) {
190
+ uint8_t dst[4];
191
+ bufsize_t len = 0;
192
+
193
+ assert(uc >= 0);
194
+
195
+ if (uc < 0x80) {
196
+ dst[0] = (uint8_t)(uc);
197
+ len = 1;
198
+ } else if (uc < 0x800) {
199
+ dst[0] = (uint8_t)(0xC0 + (uc >> 6));
200
+ dst[1] = 0x80 + (uc & 0x3F);
201
+ len = 2;
202
+ } else if (uc == 0xFFFF) {
203
+ dst[0] = 0xFF;
204
+ len = 1;
205
+ } else if (uc == 0xFFFE) {
206
+ dst[0] = 0xFE;
207
+ len = 1;
208
+ } else if (uc < 0x10000) {
209
+ dst[0] = (uint8_t)(0xE0 + (uc >> 12));
210
+ dst[1] = 0x80 + ((uc >> 6) & 0x3F);
211
+ dst[2] = 0x80 + (uc & 0x3F);
212
+ len = 3;
213
+ } else if (uc < 0x110000) {
214
+ dst[0] = (uint8_t)(0xF0 + (uc >> 18));
215
+ dst[1] = 0x80 + ((uc >> 12) & 0x3F);
216
+ dst[2] = 0x80 + ((uc >> 6) & 0x3F);
217
+ dst[3] = 0x80 + (uc & 0x3F);
218
+ len = 4;
219
+ } else {
220
+ encode_unknown(buf);
221
+ return;
222
+ }
223
+
224
+ cmark_strbuf_put(buf, dst, len);
225
+ }
226
+
227
+ void cmark_utf8proc_case_fold(cmark_strbuf *dest, const uint8_t *str,
228
+ bufsize_t len) {
229
+ int32_t c;
230
+
231
+ #define bufpush(x) cmark_utf8proc_encode_char(x, dest)
232
+
233
+ while (len > 0) {
234
+ bufsize_t char_len = cmark_utf8proc_iterate(str, len, &c);
235
+
236
+ if (char_len >= 0) {
237
+ #include "case_fold_switch.inc"
238
+ } else {
239
+ encode_unknown(dest);
240
+ char_len = -char_len;
241
+ }
242
+
243
+ str += char_len;
244
+ len -= char_len;
245
+ }
246
+ }
247
+
248
+ // matches anything in the Zs class, plus LF, CR, TAB, FF.
249
+ int cmark_utf8proc_is_space(int32_t uc) {
250
+ return (uc == 9 || uc == 10 || uc == 12 || uc == 13 || uc == 32 ||
251
+ uc == 160 || uc == 5760 || (uc >= 8192 && uc <= 8202) || uc == 8239 ||
252
+ uc == 8287 || uc == 12288);
253
+ }
254
+
255
+ // matches anything in the P[cdefios] classes.
256
+ int cmark_utf8proc_is_punctuation(int32_t uc) {
257
+ return (
258
+ (uc < 128 && cmark_ispunct((char)uc)) || uc == 161 || uc == 167 ||
259
+ uc == 171 || uc == 182 || uc == 183 || uc == 187 || uc == 191 ||
260
+ uc == 894 || uc == 903 || (uc >= 1370 && uc <= 1375) || uc == 1417 ||
261
+ uc == 1418 || uc == 1470 || uc == 1472 || uc == 1475 || uc == 1478 ||
262
+ uc == 1523 || uc == 1524 || uc == 1545 || uc == 1546 || uc == 1548 ||
263
+ uc == 1549 || uc == 1563 || uc == 1566 || uc == 1567 ||
264
+ (uc >= 1642 && uc <= 1645) || uc == 1748 || (uc >= 1792 && uc <= 1805) ||
265
+ (uc >= 2039 && uc <= 2041) || (uc >= 2096 && uc <= 2110) || uc == 2142 ||
266
+ uc == 2404 || uc == 2405 || uc == 2416 || uc == 2800 || uc == 3572 ||
267
+ uc == 3663 || uc == 3674 || uc == 3675 || (uc >= 3844 && uc <= 3858) ||
268
+ uc == 3860 || (uc >= 3898 && uc <= 3901) || uc == 3973 ||
269
+ (uc >= 4048 && uc <= 4052) || uc == 4057 || uc == 4058 ||
270
+ (uc >= 4170 && uc <= 4175) || uc == 4347 || (uc >= 4960 && uc <= 4968) ||
271
+ uc == 5120 || uc == 5741 || uc == 5742 || uc == 5787 || uc == 5788 ||
272
+ (uc >= 5867 && uc <= 5869) || uc == 5941 || uc == 5942 ||
273
+ (uc >= 6100 && uc <= 6102) || (uc >= 6104 && uc <= 6106) ||
274
+ (uc >= 6144 && uc <= 6154) || uc == 6468 || uc == 6469 || uc == 6686 ||
275
+ uc == 6687 || (uc >= 6816 && uc <= 6822) || (uc >= 6824 && uc <= 6829) ||
276
+ (uc >= 7002 && uc <= 7008) || (uc >= 7164 && uc <= 7167) ||
277
+ (uc >= 7227 && uc <= 7231) || uc == 7294 || uc == 7295 ||
278
+ (uc >= 7360 && uc <= 7367) || uc == 7379 || (uc >= 8208 && uc <= 8231) ||
279
+ (uc >= 8240 && uc <= 8259) || (uc >= 8261 && uc <= 8273) ||
280
+ (uc >= 8275 && uc <= 8286) || uc == 8317 || uc == 8318 || uc == 8333 ||
281
+ uc == 8334 || (uc >= 8968 && uc <= 8971) || uc == 9001 || uc == 9002 ||
282
+ (uc >= 10088 && uc <= 10101) || uc == 10181 || uc == 10182 ||
283
+ (uc >= 10214 && uc <= 10223) || (uc >= 10627 && uc <= 10648) ||
284
+ (uc >= 10712 && uc <= 10715) || uc == 10748 || uc == 10749 ||
285
+ (uc >= 11513 && uc <= 11516) || uc == 11518 || uc == 11519 ||
286
+ uc == 11632 || (uc >= 11776 && uc <= 11822) ||
287
+ (uc >= 11824 && uc <= 11842) || (uc >= 12289 && uc <= 12291) ||
288
+ (uc >= 12296 && uc <= 12305) || (uc >= 12308 && uc <= 12319) ||
289
+ uc == 12336 || uc == 12349 || uc == 12448 || uc == 12539 || uc == 42238 ||
290
+ uc == 42239 || (uc >= 42509 && uc <= 42511) || uc == 42611 ||
291
+ uc == 42622 || (uc >= 42738 && uc <= 42743) ||
292
+ (uc >= 43124 && uc <= 43127) || uc == 43214 || uc == 43215 ||
293
+ (uc >= 43256 && uc <= 43258) || uc == 43310 || uc == 43311 ||
294
+ uc == 43359 || (uc >= 43457 && uc <= 43469) || uc == 43486 ||
295
+ uc == 43487 || (uc >= 43612 && uc <= 43615) || uc == 43742 ||
296
+ uc == 43743 || uc == 43760 || uc == 43761 || uc == 44011 || uc == 64830 ||
297
+ uc == 64831 || (uc >= 65040 && uc <= 65049) ||
298
+ (uc >= 65072 && uc <= 65106) || (uc >= 65108 && uc <= 65121) ||
299
+ uc == 65123 || uc == 65128 || uc == 65130 || uc == 65131 ||
300
+ (uc >= 65281 && uc <= 65283) || (uc >= 65285 && uc <= 65290) ||
301
+ (uc >= 65292 && uc <= 65295) || uc == 65306 || uc == 65307 ||
302
+ uc == 65311 || uc == 65312 || (uc >= 65339 && uc <= 65341) ||
303
+ uc == 65343 || uc == 65371 || uc == 65373 ||
304
+ (uc >= 65375 && uc <= 65381) || (uc >= 65792 && uc <= 65794) ||
305
+ uc == 66463 || uc == 66512 || uc == 66927 || uc == 67671 || uc == 67871 ||
306
+ uc == 67903 || (uc >= 68176 && uc <= 68184) || uc == 68223 ||
307
+ (uc >= 68336 && uc <= 68342) || (uc >= 68409 && uc <= 68415) ||
308
+ (uc >= 68505 && uc <= 68508) || (uc >= 69703 && uc <= 69709) ||
309
+ uc == 69819 || uc == 69820 || (uc >= 69822 && uc <= 69825) ||
310
+ (uc >= 69952 && uc <= 69955) || uc == 70004 || uc == 70005 ||
311
+ (uc >= 70085 && uc <= 70088) || uc == 70093 ||
312
+ (uc >= 70200 && uc <= 70205) || uc == 70854 ||
313
+ (uc >= 71105 && uc <= 71113) || (uc >= 71233 && uc <= 71235) ||
314
+ (uc >= 74864 && uc <= 74868) || uc == 92782 || uc == 92783 ||
315
+ uc == 92917 || (uc >= 92983 && uc <= 92987) || uc == 92996 ||
316
+ uc == 113823);
317
+ }
@@ -0,0 +1,35 @@
1
+ #ifndef CMARK_UTF8_H
2
+ #define CMARK_UTF8_H
3
+
4
+ #include <stdint.h>
5
+ #include "buffer.h"
6
+
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ CMARK_EXPORT
12
+ void cmark_utf8proc_case_fold(cmark_strbuf *dest, const uint8_t *str,
13
+ bufsize_t len);
14
+
15
+ CMARK_EXPORT
16
+ void cmark_utf8proc_encode_char(int32_t uc, cmark_strbuf *buf);
17
+
18
+ CMARK_EXPORT
19
+ int cmark_utf8proc_iterate(const uint8_t *str, bufsize_t str_len, int32_t *dst);
20
+
21
+ CMARK_EXPORT
22
+ void cmark_utf8proc_check(cmark_strbuf *dest, const uint8_t *line,
23
+ bufsize_t size);
24
+
25
+ CMARK_EXPORT
26
+ int cmark_utf8proc_is_space(int32_t uc);
27
+
28
+ CMARK_EXPORT
29
+ int cmark_utf8proc_is_punctuation(int32_t uc);
30
+
31
+ #ifdef __cplusplus
32
+ }
33
+ #endif
34
+
35
+ #endif
@@ -0,0 +1,174 @@
1
+ #include <stdlib.h>
2
+ #include <stdio.h>
3
+ #include <string.h>
4
+ #include <assert.h>
5
+
6
+ #include "config.h"
7
+ #include "cmark.h"
8
+ #include "node.h"
9
+ #include "buffer.h"
10
+ #include "houdini.h"
11
+
12
+ #define BUFFER_SIZE 100
13
+
14
+ // Functions to convert cmark_nodes to XML strings.
15
+
16
+ static void escape_xml(cmark_strbuf *dest, const unsigned char *source,
17
+ bufsize_t length) {
18
+ houdini_escape_html0(dest, source, length, 0);
19
+ }
20
+
21
+ struct render_state {
22
+ cmark_strbuf *xml;
23
+ int indent;
24
+ };
25
+
26
+ static CMARK_INLINE void indent(struct render_state *state) {
27
+ int i;
28
+ for (i = 0; i < state->indent; i++) {
29
+ cmark_strbuf_putc(state->xml, ' ');
30
+ }
31
+ }
32
+
33
+ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
34
+ struct render_state *state, int options) {
35
+ cmark_strbuf *xml = state->xml;
36
+ bool literal = false;
37
+ cmark_delim_type delim;
38
+ bool entering = (ev_type == CMARK_EVENT_ENTER);
39
+ char buffer[BUFFER_SIZE];
40
+
41
+ if (entering) {
42
+ indent(state);
43
+ cmark_strbuf_putc(xml, '<');
44
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
45
+
46
+ if (options & CMARK_OPT_SOURCEPOS && node->start_line != 0) {
47
+ snprintf(buffer, BUFFER_SIZE, " sourcepos=\"%d:%d-%d:%d\"",
48
+ node->start_line, node->start_column, node->end_line,
49
+ node->end_column);
50
+ cmark_strbuf_puts(xml, buffer);
51
+ }
52
+
53
+ literal = false;
54
+
55
+ switch (node->type) {
56
+ case CMARK_NODE_DOCUMENT:
57
+ cmark_strbuf_puts(xml, " xmlns=\"http://commonmark.org/xml/1.0\"");
58
+ break;
59
+ case CMARK_NODE_TEXT:
60
+ case CMARK_NODE_CODE:
61
+ case CMARK_NODE_HTML_BLOCK:
62
+ case CMARK_NODE_HTML_INLINE:
63
+ cmark_strbuf_puts(xml, ">");
64
+ escape_xml(xml, node->as.literal.data, node->as.literal.len);
65
+ cmark_strbuf_puts(xml, "</");
66
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
67
+ literal = true;
68
+ break;
69
+ case CMARK_NODE_LIST:
70
+ switch (cmark_node_get_list_type(node)) {
71
+ case CMARK_ORDERED_LIST:
72
+ cmark_strbuf_puts(xml, " type=\"ordered\"");
73
+ snprintf(buffer, BUFFER_SIZE, " start=\"%d\"",
74
+ cmark_node_get_list_start(node));
75
+ cmark_strbuf_puts(xml, buffer);
76
+ delim = cmark_node_get_list_delim(node);
77
+ if (delim == CMARK_PAREN_DELIM) {
78
+ cmark_strbuf_puts(xml, " delim=\"paren\"");
79
+ } else if (delim == CMARK_PERIOD_DELIM) {
80
+ cmark_strbuf_puts(xml, " delim=\"period\"");
81
+ }
82
+ break;
83
+ case CMARK_BULLET_LIST:
84
+ cmark_strbuf_puts(xml, " type=\"bullet\"");
85
+ break;
86
+ default:
87
+ break;
88
+ }
89
+ snprintf(buffer, BUFFER_SIZE, " tight=\"%s\"",
90
+ (cmark_node_get_list_tight(node) ? "true" : "false"));
91
+ cmark_strbuf_puts(xml, buffer);
92
+ break;
93
+ case CMARK_NODE_HEADING:
94
+ snprintf(buffer, BUFFER_SIZE, " level=\"%d\"", node->as.heading.level);
95
+ cmark_strbuf_puts(xml, buffer);
96
+ break;
97
+ case CMARK_NODE_CODE_BLOCK:
98
+ if (node->as.code.info.len > 0) {
99
+ cmark_strbuf_puts(xml, " info=\"");
100
+ escape_xml(xml, node->as.code.info.data, node->as.code.info.len);
101
+ cmark_strbuf_putc(xml, '"');
102
+ }
103
+ cmark_strbuf_puts(xml, ">");
104
+ escape_xml(xml, node->as.code.literal.data, node->as.code.literal.len);
105
+ cmark_strbuf_puts(xml, "</");
106
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
107
+ literal = true;
108
+ break;
109
+ case CMARK_NODE_CUSTOM_BLOCK:
110
+ case CMARK_NODE_CUSTOM_INLINE:
111
+ cmark_strbuf_puts(xml, " on_enter=\"");
112
+ escape_xml(xml, node->as.custom.on_enter.data,
113
+ node->as.custom.on_enter.len);
114
+ cmark_strbuf_putc(xml, '"');
115
+ cmark_strbuf_puts(xml, " on_exit=\"");
116
+ escape_xml(xml, node->as.custom.on_exit.data,
117
+ node->as.custom.on_exit.len);
118
+ cmark_strbuf_putc(xml, '"');
119
+ break;
120
+ case CMARK_NODE_LINK:
121
+ case CMARK_NODE_IMAGE:
122
+ cmark_strbuf_puts(xml, " destination=\"");
123
+ escape_xml(xml, node->as.link.url.data, node->as.link.url.len);
124
+ cmark_strbuf_putc(xml, '"');
125
+ cmark_strbuf_puts(xml, " title=\"");
126
+ escape_xml(xml, node->as.link.title.data, node->as.link.title.len);
127
+ cmark_strbuf_putc(xml, '"');
128
+ break;
129
+ default:
130
+ break;
131
+ }
132
+ if (node->first_child) {
133
+ state->indent += 2;
134
+ } else if (!literal) {
135
+ cmark_strbuf_puts(xml, " /");
136
+ }
137
+ cmark_strbuf_puts(xml, ">\n");
138
+
139
+ } else if (node->first_child) {
140
+ state->indent -= 2;
141
+ indent(state);
142
+ cmark_strbuf_puts(xml, "</");
143
+ cmark_strbuf_puts(xml, cmark_node_get_type_string(node));
144
+ cmark_strbuf_puts(xml, ">\n");
145
+ }
146
+
147
+ return 1;
148
+ }
149
+
150
+ char *cmark_render_xml(cmark_node *root, int options) {
151
+ return cmark_render_xml_with_mem(root, options, cmark_node_mem(root));
152
+ }
153
+
154
+ char *cmark_render_xml_with_mem(cmark_node *root, int options, cmark_mem *mem) {
155
+ char *result;
156
+ cmark_strbuf xml = CMARK_BUF_INIT(mem);
157
+ cmark_event_type ev_type;
158
+ cmark_node *cur;
159
+ struct render_state state = {&xml, 0};
160
+
161
+ cmark_iter *iter = cmark_iter_new(root);
162
+
163
+ cmark_strbuf_puts(state.xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
164
+ cmark_strbuf_puts(state.xml,
165
+ "<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n");
166
+ while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
167
+ cur = cmark_iter_get_node(iter);
168
+ S_render_node(cur, ev_type, &state, options);
169
+ }
170
+ result = (char *)cmark_strbuf_detach(&xml);
171
+
172
+ cmark_iter_free(iter);
173
+ return result;
174
+ }