commonmarker 0.17.7 → 0.17.7.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 (337) hide show
  1. checksums.yaml +4 -4
  2. data/commonmarker.gemspec +1 -1
  3. data/lib/commonmarker/version.rb +1 -1
  4. metadata +2 -335
  5. data/ext/commonmarker/cmark-upstream/CMakeLists.txt +0 -44
  6. data/ext/commonmarker/cmark-upstream/COPYING +0 -170
  7. data/ext/commonmarker/cmark-upstream/FindAsan.cmake +0 -74
  8. data/ext/commonmarker/cmark-upstream/Makefile +0 -226
  9. data/ext/commonmarker/cmark-upstream/Makefile.nmake +0 -36
  10. data/ext/commonmarker/cmark-upstream/README.md +0 -206
  11. data/ext/commonmarker/cmark-upstream/api_test/CMakeLists.txt +0 -26
  12. data/ext/commonmarker/cmark-upstream/api_test/cplusplus.cpp +0 -15
  13. data/ext/commonmarker/cmark-upstream/api_test/cplusplus.h +0 -16
  14. data/ext/commonmarker/cmark-upstream/api_test/harness.c +0 -110
  15. data/ext/commonmarker/cmark-upstream/api_test/harness.h +0 -35
  16. data/ext/commonmarker/cmark-upstream/api_test/main.c +0 -1116
  17. data/ext/commonmarker/cmark-upstream/appveyor.yml +0 -17
  18. data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-flat.md +0 -16
  19. data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-nested.md +0 -13
  20. data/ext/commonmarker/cmark-upstream/bench/samples/block-code.md +0 -11
  21. data/ext/commonmarker/cmark-upstream/bench/samples/block-fences.md +0 -14
  22. data/ext/commonmarker/cmark-upstream/bench/samples/block-heading.md +0 -9
  23. data/ext/commonmarker/cmark-upstream/bench/samples/block-hr.md +0 -10
  24. data/ext/commonmarker/cmark-upstream/bench/samples/block-html.md +0 -32
  25. data/ext/commonmarker/cmark-upstream/bench/samples/block-lheading.md +0 -8
  26. data/ext/commonmarker/cmark-upstream/bench/samples/block-list-flat.md +0 -67
  27. data/ext/commonmarker/cmark-upstream/bench/samples/block-list-nested.md +0 -36
  28. data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-flat.md +0 -15
  29. data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-nested.md +0 -17
  30. data/ext/commonmarker/cmark-upstream/bench/samples/inline-autolink.md +0 -14
  31. data/ext/commonmarker/cmark-upstream/bench/samples/inline-backticks.md +0 -3
  32. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-flat.md +0 -5
  33. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-nested.md +0 -5
  34. data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-worst.md +0 -5
  35. data/ext/commonmarker/cmark-upstream/bench/samples/inline-entity.md +0 -11
  36. data/ext/commonmarker/cmark-upstream/bench/samples/inline-escape.md +0 -15
  37. data/ext/commonmarker/cmark-upstream/bench/samples/inline-html.md +0 -44
  38. data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-flat.md +0 -23
  39. data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-nested.md +0 -13
  40. data/ext/commonmarker/cmark-upstream/bench/samples/inline-newlines.md +0 -24
  41. data/ext/commonmarker/cmark-upstream/bench/samples/lorem1.md +0 -13
  42. data/ext/commonmarker/cmark-upstream/bench/samples/rawtabs.md +0 -18
  43. data/ext/commonmarker/cmark-upstream/bench/statistics.py +0 -595
  44. data/ext/commonmarker/cmark-upstream/bench/stats.py +0 -19
  45. data/ext/commonmarker/cmark-upstream/benchmarks.md +0 -33
  46. data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +0 -478
  47. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +0 -71
  48. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +0 -73
  49. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_C.bin +0 -0
  50. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_CXX.bin +0 -0
  51. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeSystem.cmake +0 -15
  52. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +0 -567
  53. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/a.out +0 -0
  54. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -539
  55. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
  56. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  57. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +0 -18
  58. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +0 -709
  59. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +0 -157
  60. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +0 -391
  61. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +0 -48
  62. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +0 -1
  63. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
  64. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +0 -34
  65. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +0 -405
  66. data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +0 -1
  67. data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +0 -11
  68. data/ext/commonmarker/cmark-upstream/build/Makefile +0 -280
  69. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  70. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +0 -134
  71. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +0 -38
  72. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +0 -38
  73. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +0 -169
  74. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +0 -12
  75. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
  76. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.internal +0 -28
  77. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +0 -28
  78. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +0 -17
  79. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
  80. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/link.txt +0 -1
  81. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
  82. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/progress.make +0 -5
  83. data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +0 -1
  84. data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +0 -302
  85. data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
  86. data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +0 -29
  87. data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +0 -49
  88. data/ext/commonmarker/cmark-upstream/build/compile_commands.json +0 -352
  89. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  90. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +0 -30
  91. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +0 -108
  92. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +0 -246
  93. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +0 -36
  94. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/autolink.c.o +0 -0
  95. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/build.make +0 -253
  96. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +0 -16
  97. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/core-extensions.c.o +0 -0
  98. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.internal +0 -96
  99. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +0 -96
  100. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/ext_scanners.c.o +0 -0
  101. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/flags.make +0 -10
  102. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +0 -1
  103. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +0 -8
  104. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/strikethrough.c.o +0 -0
  105. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/table.c.o +0 -0
  106. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/tagfilter.c.o +0 -0
  107. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/C.includecache +0 -246
  108. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +0 -29
  109. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/autolink.c.o +0 -0
  110. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/build.make +0 -249
  111. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +0 -15
  112. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +0 -3
  113. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/core-extensions.c.o +0 -0
  114. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.internal +0 -96
  115. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +0 -96
  116. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/ext_scanners.c.o +0 -0
  117. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/flags.make +0 -10
  118. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +0 -2
  119. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +0 -8
  120. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/strikethrough.c.o +0 -0
  121. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/table.c.o +0 -0
  122. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/tagfilter.c.o +0 -0
  123. data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/progress.marks +0 -1
  124. data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +0 -426
  125. data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +0 -84
  126. data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +0 -42
  127. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.0.28.3.gfm.11.dylib +0 -0
  128. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.a +0 -0
  129. data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.dylib +0 -1
  130. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  131. data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +0 -1
  132. data/ext/commonmarker/cmark-upstream/build/man/Makefile +0 -196
  133. data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +0 -37
  134. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  135. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +0 -38
  136. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +0 -95
  137. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +0 -156
  138. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +0 -30
  139. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +0 -115
  140. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +0 -10
  141. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +0 -20
  142. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +0 -20
  143. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +0 -10
  144. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +0 -1
  145. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/main.c.o +0 -0
  146. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/progress.make +0 -3
  147. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +0 -612
  148. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +0 -60
  149. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/arena.c.o +0 -0
  150. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/blocks.c.o +0 -0
  151. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/buffer.c.o +0 -0
  152. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/build.make +0 -819
  153. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +0 -37
  154. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark.c.o +0 -0
  155. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark_ctype.c.o +0 -0
  156. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/commonmark.c.o +0 -0
  157. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.internal +0 -319
  158. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +0 -319
  159. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +0 -10
  160. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/footnotes.c.o +0 -0
  161. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_href_e.c.o +0 -0
  162. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_e.c.o +0 -0
  163. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_u.c.o +0 -0
  164. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/html.c.o +0 -0
  165. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/inlines.c.o +0 -0
  166. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/iterator.c.o +0 -0
  167. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/latex.c.o +0 -0
  168. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/link.txt +0 -1
  169. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/linked_list.c.o +0 -0
  170. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/man.c.o +0 -0
  171. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/map.c.o +0 -0
  172. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/node.c.o +0 -0
  173. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plaintext.c.o +0 -0
  174. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plugin.c.o +0 -0
  175. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/progress.make +0 -29
  176. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/references.c.o +0 -0
  177. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/registry.c.o +0 -0
  178. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/render.c.o +0 -0
  179. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/scanners.c.o +0 -0
  180. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/syntax_extension.c.o +0 -0
  181. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/utf8.c.o +0 -0
  182. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/xml.c.o +0 -0
  183. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/C.includecache +0 -612
  184. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +0 -54
  185. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/arena.c.o +0 -0
  186. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/blocks.c.o +0 -0
  187. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/buffer.c.o +0 -0
  188. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/build.make +0 -816
  189. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +0 -36
  190. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +0 -3
  191. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark.c.o +0 -0
  192. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark_ctype.c.o +0 -0
  193. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/commonmark.c.o +0 -0
  194. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.internal +0 -319
  195. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +0 -319
  196. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +0 -10
  197. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/footnotes.c.o +0 -0
  198. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_href_e.c.o +0 -0
  199. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_e.c.o +0 -0
  200. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_u.c.o +0 -0
  201. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/html.c.o +0 -0
  202. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/inlines.c.o +0 -0
  203. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/iterator.c.o +0 -0
  204. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/latex.c.o +0 -0
  205. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/link.txt +0 -2
  206. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/linked_list.c.o +0 -0
  207. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/man.c.o +0 -0
  208. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/map.c.o +0 -0
  209. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/node.c.o +0 -0
  210. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plaintext.c.o +0 -0
  211. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plugin.c.o +0 -0
  212. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/progress.make +0 -29
  213. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/references.c.o +0 -0
  214. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/registry.c.o +0 -0
  215. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/render.c.o +0 -0
  216. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/scanners.c.o +0 -0
  217. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/syntax_extension.c.o +0 -0
  218. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/utf8.c.o +0 -0
  219. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/xml.c.o +0 -0
  220. data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/progress.marks +0 -1
  221. data/ext/commonmarker/cmark-upstream/build/src/Makefile +0 -1165
  222. data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +0 -97
  223. data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
  224. data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +0 -42
  225. data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +0 -8
  226. data/ext/commonmarker/cmark-upstream/build/src/config.h +0 -76
  227. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.0.28.3.gfm.11.dylib +0 -0
  228. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.a +0 -0
  229. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.dylib +0 -1
  230. data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +0 -10
  231. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
  232. data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +0 -1
  233. data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +0 -17
  234. data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +0 -196
  235. data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +0 -29
  236. data/ext/commonmarker/cmark-upstream/changelog.txt +0 -964
  237. data/ext/commonmarker/cmark-upstream/data/CaseFolding.txt +0 -1495
  238. data/ext/commonmarker/cmark-upstream/extensions/CMakeLists.txt +0 -124
  239. data/ext/commonmarker/cmark-upstream/extensions/autolink.c +0 -421
  240. data/ext/commonmarker/cmark-upstream/extensions/autolink.h +0 -8
  241. data/ext/commonmarker/cmark-upstream/extensions/core-extensions.c +0 -25
  242. data/ext/commonmarker/cmark-upstream/extensions/core-extensions.h +0 -25
  243. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.c +0 -941
  244. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.h +0 -22
  245. data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.re +0 -74
  246. data/ext/commonmarker/cmark-upstream/extensions/strikethrough.c +0 -157
  247. data/ext/commonmarker/cmark-upstream/extensions/strikethrough.h +0 -9
  248. data/ext/commonmarker/cmark-upstream/extensions/table.c +0 -683
  249. data/ext/commonmarker/cmark-upstream/extensions/table.h +0 -8
  250. data/ext/commonmarker/cmark-upstream/extensions/tagfilter.c +0 -60
  251. data/ext/commonmarker/cmark-upstream/extensions/tagfilter.h +0 -8
  252. data/ext/commonmarker/cmark-upstream/man/CMakeLists.txt +0 -10
  253. data/ext/commonmarker/cmark-upstream/man/make_man_page.py +0 -133
  254. data/ext/commonmarker/cmark-upstream/man/man1/cmark-gfm.1 +0 -78
  255. data/ext/commonmarker/cmark-upstream/man/man3/cmark-gfm.3 +0 -989
  256. data/ext/commonmarker/cmark-upstream/nmake.bat +0 -1
  257. data/ext/commonmarker/cmark-upstream/src/CMakeLists.txt +0 -224
  258. data/ext/commonmarker/cmark-upstream/src/arena.c +0 -103
  259. data/ext/commonmarker/cmark-upstream/src/blocks.c +0 -1519
  260. data/ext/commonmarker/cmark-upstream/src/buffer.c +0 -279
  261. data/ext/commonmarker/cmark-upstream/src/buffer.h +0 -116
  262. data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +0 -4327
  263. data/ext/commonmarker/cmark-upstream/src/chunk.h +0 -136
  264. data/ext/commonmarker/cmark-upstream/src/cmark.c +0 -55
  265. data/ext/commonmarker/cmark-upstream/src/cmark.h +0 -789
  266. data/ext/commonmarker/cmark-upstream/src/cmark_ctype.c +0 -44
  267. data/ext/commonmarker/cmark-upstream/src/cmark_ctype.h +0 -33
  268. data/ext/commonmarker/cmark-upstream/src/cmark_extension_api.h +0 -719
  269. data/ext/commonmarker/cmark-upstream/src/cmark_version.h.in +0 -8
  270. data/ext/commonmarker/cmark-upstream/src/commonmark.c +0 -508
  271. data/ext/commonmarker/cmark-upstream/src/config.h.in +0 -76
  272. data/ext/commonmarker/cmark-upstream/src/entities.inc +0 -2138
  273. data/ext/commonmarker/cmark-upstream/src/footnotes.c +0 -40
  274. data/ext/commonmarker/cmark-upstream/src/footnotes.h +0 -25
  275. data/ext/commonmarker/cmark-upstream/src/houdini.h +0 -57
  276. data/ext/commonmarker/cmark-upstream/src/houdini_href_e.c +0 -100
  277. data/ext/commonmarker/cmark-upstream/src/houdini_html_e.c +0 -66
  278. data/ext/commonmarker/cmark-upstream/src/houdini_html_u.c +0 -149
  279. data/ext/commonmarker/cmark-upstream/src/html.c +0 -457
  280. data/ext/commonmarker/cmark-upstream/src/html.h +0 -27
  281. data/ext/commonmarker/cmark-upstream/src/inlines.c +0 -1594
  282. data/ext/commonmarker/cmark-upstream/src/inlines.h +0 -29
  283. data/ext/commonmarker/cmark-upstream/src/iterator.c +0 -159
  284. data/ext/commonmarker/cmark-upstream/src/iterator.h +0 -27
  285. data/ext/commonmarker/cmark-upstream/src/latex.c +0 -466
  286. data/ext/commonmarker/cmark-upstream/src/libcmark-gfm.pc.in +0 -10
  287. data/ext/commonmarker/cmark-upstream/src/linked_list.c +0 -37
  288. data/ext/commonmarker/cmark-upstream/src/main.c +0 -276
  289. data/ext/commonmarker/cmark-upstream/src/man.c +0 -278
  290. data/ext/commonmarker/cmark-upstream/src/map.c +0 -122
  291. data/ext/commonmarker/cmark-upstream/src/map.h +0 -42
  292. data/ext/commonmarker/cmark-upstream/src/node.c +0 -965
  293. data/ext/commonmarker/cmark-upstream/src/node.h +0 -116
  294. data/ext/commonmarker/cmark-upstream/src/parser.h +0 -57
  295. data/ext/commonmarker/cmark-upstream/src/plaintext.c +0 -213
  296. data/ext/commonmarker/cmark-upstream/src/plugin.c +0 -36
  297. data/ext/commonmarker/cmark-upstream/src/plugin.h +0 -34
  298. data/ext/commonmarker/cmark-upstream/src/references.c +0 -42
  299. data/ext/commonmarker/cmark-upstream/src/references.h +0 -26
  300. data/ext/commonmarker/cmark-upstream/src/registry.c +0 -63
  301. data/ext/commonmarker/cmark-upstream/src/registry.h +0 -24
  302. data/ext/commonmarker/cmark-upstream/src/render.c +0 -202
  303. data/ext/commonmarker/cmark-upstream/src/render.h +0 -63
  304. data/ext/commonmarker/cmark-upstream/src/scanners.c +0 -18195
  305. data/ext/commonmarker/cmark-upstream/src/scanners.h +0 -64
  306. data/ext/commonmarker/cmark-upstream/src/scanners.re +0 -341
  307. data/ext/commonmarker/cmark-upstream/src/syntax_extension.c +0 -139
  308. data/ext/commonmarker/cmark-upstream/src/syntax_extension.h +0 -32
  309. data/ext/commonmarker/cmark-upstream/src/utf8.c +0 -317
  310. data/ext/commonmarker/cmark-upstream/src/utf8.h +0 -35
  311. data/ext/commonmarker/cmark-upstream/src/xml.c +0 -174
  312. data/ext/commonmarker/cmark-upstream/suppressions +0 -10
  313. data/ext/commonmarker/cmark-upstream/test/CMakeLists.txt +0 -98
  314. data/ext/commonmarker/cmark-upstream/test/afl_test_cases/test.md +0 -49
  315. data/ext/commonmarker/cmark-upstream/test/cmark-fuzz.c +0 -28
  316. data/ext/commonmarker/cmark-upstream/test/cmark.py +0 -103
  317. data/ext/commonmarker/cmark-upstream/test/entity_tests.py +0 -67
  318. data/ext/commonmarker/cmark-upstream/test/extensions.txt +0 -674
  319. data/ext/commonmarker/cmark-upstream/test/fuzzing_dictionary +0 -49
  320. data/ext/commonmarker/cmark-upstream/test/normalize.py +0 -194
  321. data/ext/commonmarker/cmark-upstream/test/pathological_tests.py +0 -145
  322. data/ext/commonmarker/cmark-upstream/test/regression.txt +0 -128
  323. data/ext/commonmarker/cmark-upstream/test/roundtrip_tests.py +0 -50
  324. data/ext/commonmarker/cmark-upstream/test/run-cmark-fuzz +0 -4
  325. data/ext/commonmarker/cmark-upstream/test/smart_punct.txt +0 -177
  326. data/ext/commonmarker/cmark-upstream/test/spec.txt +0 -9919
  327. data/ext/commonmarker/cmark-upstream/test/spec_tests.py +0 -152
  328. data/ext/commonmarker/cmark-upstream/toolchain-mingw32.cmake +0 -17
  329. data/ext/commonmarker/cmark-upstream/tools/Dockerfile +0 -41
  330. data/ext/commonmarker/cmark-upstream/tools/appveyor-build.bat +0 -13
  331. data/ext/commonmarker/cmark-upstream/tools/make_entities_inc.py +0 -32
  332. data/ext/commonmarker/cmark-upstream/tools/mkcasefold.pl +0 -22
  333. data/ext/commonmarker/cmark-upstream/why-cmark-and-not-x.md +0 -104
  334. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.js +0 -6
  335. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.py +0 -37
  336. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rb +0 -15
  337. data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rkt +0 -190
@@ -1,124 +0,0 @@
1
- cmake_minimum_required(VERSION 2.8)
2
- set(LIBRARY "libcmark-gfmextensions")
3
- set(STATICLIBRARY "libcmark-gfmextensions_static")
4
- set(LIBRARY_SOURCES
5
- core-extensions.c
6
- table.c
7
- strikethrough.c
8
- autolink.c
9
- tagfilter.c
10
- ext_scanners.c
11
- ext_scanners.re
12
- ext_scanners.h
13
- )
14
-
15
- include_directories(
16
- ${PROJECT_SOURCE_DIR}/src
17
- ${PROJECT_BINARY_DIR}/src
18
- )
19
-
20
- include (GenerateExportHeader)
21
-
22
- include_directories(. ${CMAKE_CURRENT_BINARY_DIR})
23
-
24
- set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg")
25
- set(CMAKE_LINKER_PROFILE "${CMAKE_LINKER_FLAGS_RELEASE} -pg")
26
- add_compiler_export_flags()
27
-
28
- if (CMARK_SHARED)
29
- add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
30
-
31
- set_target_properties(${LIBRARY} PROPERTIES
32
- OUTPUT_NAME "cmark-gfmextensions"
33
- SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM}
34
- VERSION ${PROJECT_VERSION})
35
-
36
- set_property(TARGET ${LIBRARY}
37
- APPEND PROPERTY MACOSX_RPATH true)
38
-
39
- # Avoid name clash between PROGRAM and LIBRARY pdb files.
40
- set_target_properties(${LIBRARY} PROPERTIES PDB_NAME cmark-gfmextensions_dll)
41
-
42
- generate_export_header(${LIBRARY}
43
- BASE_NAME cmarkextensions)
44
-
45
- list(APPEND CMARK_INSTALL ${LIBRARY})
46
- target_link_libraries(${LIBRARY} libcmark-gfm)
47
-
48
- endif()
49
-
50
- if (CMARK_STATIC)
51
- add_library(${STATICLIBRARY} STATIC ${LIBRARY_SOURCES})
52
-
53
- set_target_properties(${STATICLIBRARY} PROPERTIES
54
- COMPILE_FLAGS "-DCMARK_STATIC_DEFINE -DCMARKEXTENSIONS_STATIC_DEFINE"
55
- POSITION_INDEPENDENT_CODE ON)
56
-
57
- if (MSVC)
58
- set_target_properties(${STATICLIBRARY} PROPERTIES
59
- OUTPUT_NAME "cmark-gfmextensions_static"
60
- VERSION ${PROJECT_VERSION})
61
- else()
62
- set_target_properties(${STATICLIBRARY} PROPERTIES
63
- OUTPUT_NAME "cmark-gfmextensions"
64
- VERSION ${PROJECT_VERSION})
65
- endif(MSVC)
66
-
67
- list(APPEND CMARK_INSTALL ${STATICLIBRARY})
68
- endif()
69
-
70
- set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
71
-
72
- include (InstallRequiredSystemLibraries)
73
- install(TARGETS ${CMARK_INSTALL}
74
- EXPORT cmark-gfmextensions
75
- RUNTIME DESTINATION bin
76
- LIBRARY DESTINATION lib${LIB_SUFFIX}
77
- ARCHIVE DESTINATION lib${LIB_SUFFIX}
78
- )
79
-
80
- if (CMARK_SHARED OR CMARK_STATIC)
81
- install(FILES
82
- core-extensions.h
83
- ${CMAKE_CURRENT_BINARY_DIR}/cmarkextensions_export.h
84
- DESTINATION include
85
- )
86
-
87
- install(EXPORT cmark-gfmextensions DESTINATION lib${LIB_SUFFIX}/cmake-gfmextensions)
88
- endif()
89
-
90
- # Feature tests
91
- include(CheckIncludeFile)
92
- include(CheckCSourceCompiles)
93
- include(CheckCSourceRuns)
94
- include(CheckSymbolExists)
95
- CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
96
- CHECK_C_SOURCE_COMPILES(
97
- "int main() { __builtin_expect(0,0); return 0; }"
98
- HAVE___BUILTIN_EXPECT)
99
- CHECK_C_SOURCE_COMPILES("
100
- int f(void) __attribute__ (());
101
- int main() { return 0; }
102
- " HAVE___ATTRIBUTE__)
103
-
104
- # Always compile with warnings
105
- if(MSVC)
106
- # Force to always compile with W4
107
- if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
108
- string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
109
- else()
110
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
111
- endif()
112
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX /wd4706 /wd4204 /wd4221 /wd4100 /D_CRT_SECURE_NO_WARNINGS")
113
- elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
114
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c99 -pedantic")
115
- endif()
116
-
117
- # Compile as C++ under MSVC older than 12.0
118
- if(MSVC AND MSVC_VERSION LESS 1800)
119
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
120
- endif()
121
-
122
- if(CMAKE_BUILD_TYPE STREQUAL "Ubsan")
123
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
124
- endif()
@@ -1,421 +0,0 @@
1
- #include "autolink.h"
2
- #include <parser.h>
3
- #include <string.h>
4
- #include <utf8.h>
5
-
6
- #if defined(_WIN32)
7
- #define strncasecmp _strnicmp
8
- #else
9
- #include <strings.h>
10
- #endif
11
-
12
- static int is_valid_hostchar(const uint8_t *link, size_t link_len) {
13
- int32_t ch;
14
- int r = cmark_utf8proc_iterate(link, (bufsize_t)link_len, &ch);
15
- if (r < 0)
16
- return 0;
17
- return !cmark_utf8proc_is_space(ch) && !cmark_utf8proc_is_punctuation(ch);
18
- }
19
-
20
- static int sd_autolink_issafe(const uint8_t *link, size_t link_len) {
21
- static const size_t valid_uris_count = 3;
22
- static const char *valid_uris[] = {"http://", "https://", "ftp://"};
23
-
24
- size_t i;
25
-
26
- for (i = 0; i < valid_uris_count; ++i) {
27
- size_t len = strlen(valid_uris[i]);
28
-
29
- if (link_len > len && strncasecmp((char *)link, valid_uris[i], len) == 0 &&
30
- is_valid_hostchar(link + len, link_len - len))
31
- return 1;
32
- }
33
-
34
- return 0;
35
- }
36
-
37
- static size_t autolink_delim(uint8_t *data, size_t link_end) {
38
- uint8_t cclose, copen;
39
- size_t i;
40
-
41
- for (i = 0; i < link_end; ++i)
42
- if (data[i] == '<') {
43
- link_end = i;
44
- break;
45
- }
46
-
47
- while (link_end > 0) {
48
- cclose = data[link_end - 1];
49
-
50
- switch (cclose) {
51
- case ')':
52
- copen = '(';
53
- break;
54
- default:
55
- copen = 0;
56
- }
57
-
58
- if (strchr("?!.,:*_~'\"", data[link_end - 1]) != NULL)
59
- link_end--;
60
-
61
- else if (data[link_end - 1] == ';') {
62
- size_t new_end = link_end - 2;
63
-
64
- while (new_end > 0 && cmark_isalpha(data[new_end]))
65
- new_end--;
66
-
67
- if (new_end < link_end - 2 && data[new_end] == '&')
68
- link_end = new_end;
69
- else
70
- link_end--;
71
- } else if (copen != 0) {
72
- size_t closing = 0;
73
- size_t opening = 0;
74
- i = 0;
75
-
76
- /* Allow any number of matching brackets (as recognised in copen/cclose)
77
- * at the end of the URL. If there is a greater number of closing
78
- * brackets than opening ones, we remove one character from the end of
79
- * the link.
80
- *
81
- * Examples (input text => output linked portion):
82
- *
83
- * http://www.pokemon.com/Pikachu_(Electric)
84
- * => http://www.pokemon.com/Pikachu_(Electric)
85
- *
86
- * http://www.pokemon.com/Pikachu_((Electric)
87
- * => http://www.pokemon.com/Pikachu_((Electric)
88
- *
89
- * http://www.pokemon.com/Pikachu_(Electric))
90
- * => http://www.pokemon.com/Pikachu_(Electric)
91
- *
92
- * http://www.pokemon.com/Pikachu_((Electric))
93
- * => http://www.pokemon.com/Pikachu_((Electric))
94
- */
95
-
96
- while (i < link_end) {
97
- if (data[i] == copen)
98
- opening++;
99
- else if (data[i] == cclose)
100
- closing++;
101
-
102
- i++;
103
- }
104
-
105
- if (closing <= opening)
106
- break;
107
-
108
- link_end--;
109
- } else
110
- break;
111
- }
112
-
113
- return link_end;
114
- }
115
-
116
- static size_t check_domain(uint8_t *data, size_t size, int allow_short) {
117
- size_t i, np = 0, uscore1 = 0, uscore2 = 0;
118
-
119
- for (i = 1; i < size - 1; i++) {
120
- if (data[i] == '_')
121
- uscore2++;
122
- else if (data[i] == '.') {
123
- uscore1 = uscore2;
124
- uscore2 = 0;
125
- np++;
126
- } else if (!is_valid_hostchar(data + i, size - i) && data[i] != '-')
127
- break;
128
- }
129
-
130
- if (uscore1 > 0 || uscore2 > 0)
131
- return 0;
132
-
133
- if (allow_short) {
134
- /* We don't need a valid domain in the strict sense (with
135
- * least one dot; so just make sure it's composed of valid
136
- * domain characters and return the length of the the valid
137
- * sequence. */
138
- return i;
139
- } else {
140
- /* a valid domain needs to have at least a dot.
141
- * that's as far as we get */
142
- return np ? i : 0;
143
- }
144
- }
145
-
146
- static cmark_node *www_match(cmark_parser *parser, cmark_node *parent,
147
- cmark_inline_parser *inline_parser) {
148
- cmark_chunk *chunk = cmark_inline_parser_get_chunk(inline_parser);
149
- size_t max_rewind = cmark_inline_parser_get_offset(inline_parser);
150
- uint8_t *data = chunk->data + max_rewind;
151
- size_t size = chunk->len - max_rewind;
152
- int start = cmark_inline_parser_get_column(inline_parser);
153
-
154
- size_t link_end;
155
-
156
- if (max_rewind > 0 && strchr("*_~(", data[-1]) == NULL &&
157
- !cmark_isspace(data[-1]))
158
- return 0;
159
-
160
- if (size < 4 || memcmp(data, "www.", strlen("www.")) != 0)
161
- return 0;
162
-
163
- link_end = check_domain(data, size, 0);
164
-
165
- if (link_end == 0)
166
- return NULL;
167
-
168
- while (link_end < size && !cmark_isspace(data[link_end]))
169
- link_end++;
170
-
171
- link_end = autolink_delim(data, link_end);
172
-
173
- if (link_end == 0)
174
- return NULL;
175
-
176
- cmark_inline_parser_set_offset(inline_parser, (int)(max_rewind + link_end));
177
-
178
- cmark_node *node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
179
-
180
- cmark_strbuf buf;
181
- cmark_strbuf_init(parser->mem, &buf, 10);
182
- cmark_strbuf_puts(&buf, "http://");
183
- cmark_strbuf_put(&buf, data, (bufsize_t)link_end);
184
- node->as.link.url = cmark_chunk_buf_detach(&buf);
185
-
186
- cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
187
- text->as.literal =
188
- cmark_chunk_dup(chunk, (bufsize_t)max_rewind, (bufsize_t)link_end);
189
- cmark_node_append_child(node, text);
190
-
191
- node->start_line = text->start_line =
192
- node->end_line = text->end_line =
193
- cmark_inline_parser_get_line(inline_parser);
194
-
195
- node->start_column = text->start_column = start - 1;
196
- node->end_column = text->end_column = cmark_inline_parser_get_column(inline_parser) - 1;
197
-
198
- return node;
199
- }
200
-
201
- static cmark_node *url_match(cmark_parser *parser, cmark_node *parent,
202
- cmark_inline_parser *inline_parser) {
203
- size_t link_end, domain_len;
204
- int rewind = 0;
205
-
206
- cmark_chunk *chunk = cmark_inline_parser_get_chunk(inline_parser);
207
- int max_rewind = cmark_inline_parser_get_offset(inline_parser);
208
- uint8_t *data = chunk->data + max_rewind;
209
- size_t size = chunk->len - max_rewind;
210
-
211
- if (size < 4 || data[1] != '/' || data[2] != '/')
212
- return 0;
213
-
214
- while (rewind < max_rewind && cmark_isalpha(data[-rewind - 1]))
215
- rewind++;
216
-
217
- if (!sd_autolink_issafe(data - rewind, size + rewind))
218
- return 0;
219
-
220
- link_end = strlen("://");
221
-
222
- domain_len = check_domain(data + link_end, size - link_end, 1);
223
-
224
- if (domain_len == 0)
225
- return 0;
226
-
227
- link_end += domain_len;
228
- while (link_end < size && !cmark_isspace(data[link_end]))
229
- link_end++;
230
-
231
- link_end = autolink_delim(data, link_end);
232
-
233
- if (link_end == 0)
234
- return NULL;
235
-
236
- cmark_inline_parser_set_offset(inline_parser, (int)(max_rewind + link_end));
237
- cmark_node_unput(parent, rewind);
238
-
239
- cmark_node *node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
240
-
241
- cmark_chunk url = cmark_chunk_dup(chunk, max_rewind - rewind,
242
- (bufsize_t)(link_end + rewind));
243
- node->as.link.url = url;
244
-
245
- cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
246
- text->as.literal = url;
247
- cmark_node_append_child(node, text);
248
-
249
- return node;
250
- }
251
-
252
- static cmark_node *match(cmark_syntax_extension *ext, cmark_parser *parser,
253
- cmark_node *parent, unsigned char c,
254
- cmark_inline_parser *inline_parser) {
255
- if (cmark_inline_parser_in_bracket(inline_parser, false) ||
256
- cmark_inline_parser_in_bracket(inline_parser, true))
257
- return NULL;
258
-
259
- if (c == ':')
260
- return url_match(parser, parent, inline_parser);
261
-
262
- if (c == 'w')
263
- return www_match(parser, parent, inline_parser);
264
-
265
- return NULL;
266
-
267
- // note that we could end up re-consuming something already a
268
- // part of an inline, because we don't track when the last
269
- // inline was finished in inlines.c.
270
- }
271
-
272
- static void postprocess_text(cmark_parser *parser, cmark_node *text, int offset) {
273
- size_t link_end;
274
- uint8_t *data = text->as.literal.data,
275
- *at;
276
- size_t size = text->as.literal.len;
277
- int rewind, max_rewind,
278
- nb = 0, np = 0, ns = 0;
279
-
280
- if (offset < 0 || (size_t)offset >= size)
281
- return;
282
-
283
- data += offset;
284
- size -= offset;
285
-
286
- at = (uint8_t *)memchr(data, '@', size);
287
- if (!at)
288
- return;
289
-
290
- max_rewind = (int)(at - data);
291
- data += max_rewind;
292
- size -= max_rewind;
293
-
294
- for (rewind = 0; rewind < max_rewind; ++rewind) {
295
- uint8_t c = data[-rewind - 1];
296
-
297
- if (cmark_isalnum(c))
298
- continue;
299
-
300
- if (strchr(".+-_", c) != NULL)
301
- continue;
302
-
303
- if (c == '/')
304
- ns++;
305
-
306
- break;
307
- }
308
-
309
- if (rewind == 0 || ns > 0) {
310
- postprocess_text(parser, text, max_rewind + 1 + offset);
311
- return;
312
- }
313
-
314
- for (link_end = 0; link_end < size; ++link_end) {
315
- uint8_t c = data[link_end];
316
-
317
- if (cmark_isalnum(c))
318
- continue;
319
-
320
- if (c == '@')
321
- nb++;
322
- else if (c == '.' && link_end < size - 1 && cmark_isalnum(data[link_end + 1]))
323
- np++;
324
- else if (c != '-' && c != '_')
325
- break;
326
- }
327
-
328
- if (link_end < 2 || nb != 1 || np == 0 ||
329
- (!cmark_isalpha(data[link_end - 1]) && data[link_end - 1] != '.')) {
330
- postprocess_text(parser, text, max_rewind + 1 + offset);
331
- return;
332
- }
333
-
334
- link_end = autolink_delim(data, link_end);
335
-
336
- if (link_end == 0) {
337
- postprocess_text(parser, text, max_rewind + 1 + offset);
338
- return;
339
- }
340
-
341
- cmark_chunk_to_cstr(parser->mem, &text->as.literal);
342
-
343
- cmark_node *link_node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
344
- cmark_strbuf buf;
345
- cmark_strbuf_init(parser->mem, &buf, 10);
346
- cmark_strbuf_puts(&buf, "mailto:");
347
- cmark_strbuf_put(&buf, data - rewind, (bufsize_t)(link_end + rewind));
348
- link_node->as.link.url = cmark_chunk_buf_detach(&buf);
349
-
350
- cmark_node *link_text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
351
- cmark_chunk email = cmark_chunk_dup(
352
- &text->as.literal,
353
- offset + max_rewind - rewind,
354
- (bufsize_t)(link_end + rewind));
355
- cmark_chunk_to_cstr(parser->mem, &email);
356
- link_text->as.literal = email;
357
- cmark_node_append_child(link_node, link_text);
358
-
359
- cmark_node_insert_after(text, link_node);
360
-
361
- cmark_node *post = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
362
- post->as.literal = cmark_chunk_dup(&text->as.literal,
363
- (bufsize_t)(offset + max_rewind + link_end),
364
- (bufsize_t)(size - link_end));
365
- cmark_chunk_to_cstr(parser->mem, &post->as.literal);
366
-
367
- cmark_node_insert_after(link_node, post);
368
-
369
- text->as.literal.len = offset + max_rewind - rewind;
370
- text->as.literal.data[text->as.literal.len] = 0;
371
-
372
- postprocess_text(parser, post, 0);
373
- }
374
-
375
- static cmark_node *postprocess(cmark_syntax_extension *ext, cmark_parser *parser, cmark_node *root) {
376
- cmark_iter *iter;
377
- cmark_event_type ev;
378
- cmark_node *node;
379
- bool in_link = false;
380
-
381
- cmark_consolidate_text_nodes(root);
382
- iter = cmark_iter_new(root);
383
-
384
- while ((ev = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
385
- node = cmark_iter_get_node(iter);
386
- if (in_link) {
387
- if (ev == CMARK_EVENT_EXIT && node->type == CMARK_NODE_LINK) {
388
- in_link = false;
389
- }
390
- continue;
391
- }
392
-
393
- if (ev == CMARK_EVENT_ENTER && node->type == CMARK_NODE_LINK) {
394
- in_link = true;
395
- continue;
396
- }
397
-
398
- if (ev == CMARK_EVENT_ENTER && node->type == CMARK_NODE_TEXT) {
399
- postprocess_text(parser, node, 0);
400
- }
401
- }
402
-
403
- cmark_iter_free(iter);
404
-
405
- return root;
406
- }
407
-
408
- cmark_syntax_extension *create_autolink_extension(void) {
409
- cmark_syntax_extension *ext = cmark_syntax_extension_new("autolink");
410
- cmark_llist *special_chars = NULL;
411
-
412
- cmark_syntax_extension_set_match_inline_func(ext, match);
413
- cmark_syntax_extension_set_postprocess_func(ext, postprocess);
414
-
415
- cmark_mem *mem = cmark_get_default_mem_allocator();
416
- special_chars = cmark_llist_append(mem, special_chars, (void *)':');
417
- special_chars = cmark_llist_append(mem, special_chars, (void *)'w');
418
- cmark_syntax_extension_set_special_inline_chars(ext, special_chars);
419
-
420
- return ext;
421
- }