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.
- checksums.yaml +4 -4
- data/commonmarker.gemspec +1 -1
- data/lib/commonmarker/version.rb +1 -1
- metadata +2 -335
- data/ext/commonmarker/cmark-upstream/CMakeLists.txt +0 -44
- data/ext/commonmarker/cmark-upstream/COPYING +0 -170
- data/ext/commonmarker/cmark-upstream/FindAsan.cmake +0 -74
- data/ext/commonmarker/cmark-upstream/Makefile +0 -226
- data/ext/commonmarker/cmark-upstream/Makefile.nmake +0 -36
- data/ext/commonmarker/cmark-upstream/README.md +0 -206
- data/ext/commonmarker/cmark-upstream/api_test/CMakeLists.txt +0 -26
- data/ext/commonmarker/cmark-upstream/api_test/cplusplus.cpp +0 -15
- data/ext/commonmarker/cmark-upstream/api_test/cplusplus.h +0 -16
- data/ext/commonmarker/cmark-upstream/api_test/harness.c +0 -110
- data/ext/commonmarker/cmark-upstream/api_test/harness.h +0 -35
- data/ext/commonmarker/cmark-upstream/api_test/main.c +0 -1116
- data/ext/commonmarker/cmark-upstream/appveyor.yml +0 -17
- data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-flat.md +0 -16
- data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-nested.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/block-code.md +0 -11
- data/ext/commonmarker/cmark-upstream/bench/samples/block-fences.md +0 -14
- data/ext/commonmarker/cmark-upstream/bench/samples/block-heading.md +0 -9
- data/ext/commonmarker/cmark-upstream/bench/samples/block-hr.md +0 -10
- data/ext/commonmarker/cmark-upstream/bench/samples/block-html.md +0 -32
- data/ext/commonmarker/cmark-upstream/bench/samples/block-lheading.md +0 -8
- data/ext/commonmarker/cmark-upstream/bench/samples/block-list-flat.md +0 -67
- data/ext/commonmarker/cmark-upstream/bench/samples/block-list-nested.md +0 -36
- data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-flat.md +0 -15
- data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-nested.md +0 -17
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-autolink.md +0 -14
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-backticks.md +0 -3
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-flat.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-nested.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-worst.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-entity.md +0 -11
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-escape.md +0 -15
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-html.md +0 -44
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-flat.md +0 -23
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-nested.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-newlines.md +0 -24
- data/ext/commonmarker/cmark-upstream/bench/samples/lorem1.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/rawtabs.md +0 -18
- data/ext/commonmarker/cmark-upstream/bench/statistics.py +0 -595
- data/ext/commonmarker/cmark-upstream/bench/stats.py +0 -19
- data/ext/commonmarker/cmark-upstream/benchmarks.md +0 -33
- data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +0 -478
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +0 -71
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +0 -73
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_C.bin +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeDetermineCompilerABI_CXX.bin +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeSystem.cmake +0 -15
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +0 -567
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/a.out +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -539
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +0 -18
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +0 -709
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +0 -157
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +0 -391
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +0 -48
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +0 -1
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +0 -34
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +0 -405
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +0 -11
- data/ext/commonmarker/cmark-upstream/build/Makefile +0 -280
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +0 -134
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +0 -38
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +0 -38
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +0 -169
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +0 -12
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.internal +0 -28
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +0 -28
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +0 -17
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/link.txt +0 -1
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/progress.make +0 -5
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +0 -302
- data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +0 -29
- data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +0 -49
- data/ext/commonmarker/cmark-upstream/build/compile_commands.json +0 -352
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +0 -30
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +0 -108
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +0 -246
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +0 -36
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/autolink.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/build.make +0 -253
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/core-extensions.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.internal +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/ext_scanners.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +0 -1
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +0 -8
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/strikethrough.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/table.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/tagfilter.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/C.includecache +0 -246
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +0 -29
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/autolink.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/build.make +0 -249
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +0 -15
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +0 -3
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/core-extensions.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.internal +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/ext_scanners.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +0 -2
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +0 -8
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/strikethrough.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/table.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/tagfilter.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +0 -426
- data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +0 -84
- data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +0 -42
- data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.0.28.3.gfm.11.dylib +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.a +0 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.dylib +0 -1
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/man/Makefile +0 -196
- data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +0 -37
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +0 -38
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +0 -95
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +0 -156
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +0 -30
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +0 -115
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +0 -20
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +0 -20
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/main.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/progress.make +0 -3
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +0 -612
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +0 -60
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/arena.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/buffer.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/build.make +0 -819
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +0 -37
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmark_ctype.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.internal +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/footnotes.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_href_e.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_e.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/houdini_html_u.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/latex.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/link.txt +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/linked_list.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/map.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plaintext.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/plugin.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/progress.make +0 -29
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/references.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/registry.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/render.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/syntax_extension.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/utf8.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/C.includecache +0 -612
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +0 -54
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/arena.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/buffer.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/build.make +0 -816
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +0 -36
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +0 -3
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmark_ctype.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.internal +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/footnotes.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_href_e.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_e.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/houdini_html_u.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/latex.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/link.txt +0 -2
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/linked_list.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/map.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plaintext.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/plugin.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/progress.make +0 -29
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/references.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/registry.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/render.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/syntax_extension.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/utf8.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/Makefile +0 -1165
- data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +0 -97
- data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +0 -42
- data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +0 -8
- data/ext/commonmarker/cmark-upstream/build/src/config.h +0 -76
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.0.28.3.gfm.11.dylib +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.a +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.dylib +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +0 -10
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +0 -17
- data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +0 -196
- data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +0 -29
- data/ext/commonmarker/cmark-upstream/changelog.txt +0 -964
- data/ext/commonmarker/cmark-upstream/data/CaseFolding.txt +0 -1495
- data/ext/commonmarker/cmark-upstream/extensions/CMakeLists.txt +0 -124
- data/ext/commonmarker/cmark-upstream/extensions/autolink.c +0 -421
- data/ext/commonmarker/cmark-upstream/extensions/autolink.h +0 -8
- data/ext/commonmarker/cmark-upstream/extensions/core-extensions.c +0 -25
- data/ext/commonmarker/cmark-upstream/extensions/core-extensions.h +0 -25
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.c +0 -941
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.h +0 -22
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.re +0 -74
- data/ext/commonmarker/cmark-upstream/extensions/strikethrough.c +0 -157
- data/ext/commonmarker/cmark-upstream/extensions/strikethrough.h +0 -9
- data/ext/commonmarker/cmark-upstream/extensions/table.c +0 -683
- data/ext/commonmarker/cmark-upstream/extensions/table.h +0 -8
- data/ext/commonmarker/cmark-upstream/extensions/tagfilter.c +0 -60
- data/ext/commonmarker/cmark-upstream/extensions/tagfilter.h +0 -8
- data/ext/commonmarker/cmark-upstream/man/CMakeLists.txt +0 -10
- data/ext/commonmarker/cmark-upstream/man/make_man_page.py +0 -133
- data/ext/commonmarker/cmark-upstream/man/man1/cmark-gfm.1 +0 -78
- data/ext/commonmarker/cmark-upstream/man/man3/cmark-gfm.3 +0 -989
- data/ext/commonmarker/cmark-upstream/nmake.bat +0 -1
- data/ext/commonmarker/cmark-upstream/src/CMakeLists.txt +0 -224
- data/ext/commonmarker/cmark-upstream/src/arena.c +0 -103
- data/ext/commonmarker/cmark-upstream/src/blocks.c +0 -1519
- data/ext/commonmarker/cmark-upstream/src/buffer.c +0 -279
- data/ext/commonmarker/cmark-upstream/src/buffer.h +0 -116
- data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +0 -4327
- data/ext/commonmarker/cmark-upstream/src/chunk.h +0 -136
- data/ext/commonmarker/cmark-upstream/src/cmark.c +0 -55
- data/ext/commonmarker/cmark-upstream/src/cmark.h +0 -789
- data/ext/commonmarker/cmark-upstream/src/cmark_ctype.c +0 -44
- data/ext/commonmarker/cmark-upstream/src/cmark_ctype.h +0 -33
- data/ext/commonmarker/cmark-upstream/src/cmark_extension_api.h +0 -719
- data/ext/commonmarker/cmark-upstream/src/cmark_version.h.in +0 -8
- data/ext/commonmarker/cmark-upstream/src/commonmark.c +0 -508
- data/ext/commonmarker/cmark-upstream/src/config.h.in +0 -76
- data/ext/commonmarker/cmark-upstream/src/entities.inc +0 -2138
- data/ext/commonmarker/cmark-upstream/src/footnotes.c +0 -40
- data/ext/commonmarker/cmark-upstream/src/footnotes.h +0 -25
- data/ext/commonmarker/cmark-upstream/src/houdini.h +0 -57
- data/ext/commonmarker/cmark-upstream/src/houdini_href_e.c +0 -100
- data/ext/commonmarker/cmark-upstream/src/houdini_html_e.c +0 -66
- data/ext/commonmarker/cmark-upstream/src/houdini_html_u.c +0 -149
- data/ext/commonmarker/cmark-upstream/src/html.c +0 -457
- data/ext/commonmarker/cmark-upstream/src/html.h +0 -27
- data/ext/commonmarker/cmark-upstream/src/inlines.c +0 -1594
- data/ext/commonmarker/cmark-upstream/src/inlines.h +0 -29
- data/ext/commonmarker/cmark-upstream/src/iterator.c +0 -159
- data/ext/commonmarker/cmark-upstream/src/iterator.h +0 -27
- data/ext/commonmarker/cmark-upstream/src/latex.c +0 -466
- data/ext/commonmarker/cmark-upstream/src/libcmark-gfm.pc.in +0 -10
- data/ext/commonmarker/cmark-upstream/src/linked_list.c +0 -37
- data/ext/commonmarker/cmark-upstream/src/main.c +0 -276
- data/ext/commonmarker/cmark-upstream/src/man.c +0 -278
- data/ext/commonmarker/cmark-upstream/src/map.c +0 -122
- data/ext/commonmarker/cmark-upstream/src/map.h +0 -42
- data/ext/commonmarker/cmark-upstream/src/node.c +0 -965
- data/ext/commonmarker/cmark-upstream/src/node.h +0 -116
- data/ext/commonmarker/cmark-upstream/src/parser.h +0 -57
- data/ext/commonmarker/cmark-upstream/src/plaintext.c +0 -213
- data/ext/commonmarker/cmark-upstream/src/plugin.c +0 -36
- data/ext/commonmarker/cmark-upstream/src/plugin.h +0 -34
- data/ext/commonmarker/cmark-upstream/src/references.c +0 -42
- data/ext/commonmarker/cmark-upstream/src/references.h +0 -26
- data/ext/commonmarker/cmark-upstream/src/registry.c +0 -63
- data/ext/commonmarker/cmark-upstream/src/registry.h +0 -24
- data/ext/commonmarker/cmark-upstream/src/render.c +0 -202
- data/ext/commonmarker/cmark-upstream/src/render.h +0 -63
- data/ext/commonmarker/cmark-upstream/src/scanners.c +0 -18195
- data/ext/commonmarker/cmark-upstream/src/scanners.h +0 -64
- data/ext/commonmarker/cmark-upstream/src/scanners.re +0 -341
- data/ext/commonmarker/cmark-upstream/src/syntax_extension.c +0 -139
- data/ext/commonmarker/cmark-upstream/src/syntax_extension.h +0 -32
- data/ext/commonmarker/cmark-upstream/src/utf8.c +0 -317
- data/ext/commonmarker/cmark-upstream/src/utf8.h +0 -35
- data/ext/commonmarker/cmark-upstream/src/xml.c +0 -174
- data/ext/commonmarker/cmark-upstream/suppressions +0 -10
- data/ext/commonmarker/cmark-upstream/test/CMakeLists.txt +0 -98
- data/ext/commonmarker/cmark-upstream/test/afl_test_cases/test.md +0 -49
- data/ext/commonmarker/cmark-upstream/test/cmark-fuzz.c +0 -28
- data/ext/commonmarker/cmark-upstream/test/cmark.py +0 -103
- data/ext/commonmarker/cmark-upstream/test/entity_tests.py +0 -67
- data/ext/commonmarker/cmark-upstream/test/extensions.txt +0 -674
- data/ext/commonmarker/cmark-upstream/test/fuzzing_dictionary +0 -49
- data/ext/commonmarker/cmark-upstream/test/normalize.py +0 -194
- data/ext/commonmarker/cmark-upstream/test/pathological_tests.py +0 -145
- data/ext/commonmarker/cmark-upstream/test/regression.txt +0 -128
- data/ext/commonmarker/cmark-upstream/test/roundtrip_tests.py +0 -50
- data/ext/commonmarker/cmark-upstream/test/run-cmark-fuzz +0 -4
- data/ext/commonmarker/cmark-upstream/test/smart_punct.txt +0 -177
- data/ext/commonmarker/cmark-upstream/test/spec.txt +0 -9919
- data/ext/commonmarker/cmark-upstream/test/spec_tests.py +0 -152
- data/ext/commonmarker/cmark-upstream/toolchain-mingw32.cmake +0 -17
- data/ext/commonmarker/cmark-upstream/tools/Dockerfile +0 -41
- data/ext/commonmarker/cmark-upstream/tools/appveyor-build.bat +0 -13
- data/ext/commonmarker/cmark-upstream/tools/make_entities_inc.py +0 -32
- data/ext/commonmarker/cmark-upstream/tools/mkcasefold.pl +0 -22
- data/ext/commonmarker/cmark-upstream/why-cmark-and-not-x.md +0 -104
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.js +0 -6
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.py +0 -37
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rb +0 -15
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rkt +0 -190
@@ -1,8 +0,0 @@
|
|
1
|
-
#ifndef CMARK_VERSION_H
|
2
|
-
#define CMARK_VERSION_H
|
3
|
-
|
4
|
-
#define CMARK_VERSION ((@PROJECT_VERSION_MAJOR@ << 24) | (@PROJECT_VERSION_MINOR@ << 16) | (@PROJECT_VERSION_PATCH@ << 8) | @PROJECT_VERSION_GFM@)
|
5
|
-
#define CMARK_VERSION_STRING "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.gfm.@PROJECT_VERSION_GFM@"
|
6
|
-
#define CMARK_GFM_VERSION @PROJECT_VERSION_GFM@
|
7
|
-
|
8
|
-
#endif
|
@@ -1,508 +0,0 @@
|
|
1
|
-
#include <stdlib.h>
|
2
|
-
#include <stdio.h>
|
3
|
-
#include <string.h>
|
4
|
-
#include <stdint.h>
|
5
|
-
#include <assert.h>
|
6
|
-
|
7
|
-
#include "config.h"
|
8
|
-
#include "cmark.h"
|
9
|
-
#include "node.h"
|
10
|
-
#include "buffer.h"
|
11
|
-
#include "utf8.h"
|
12
|
-
#include "scanners.h"
|
13
|
-
#include "render.h"
|
14
|
-
#include "syntax_extension.h"
|
15
|
-
|
16
|
-
#define OUT(s, wrap, escaping) renderer->out(renderer, node, s, wrap, escaping)
|
17
|
-
#define LIT(s) renderer->out(renderer, node, s, false, LITERAL)
|
18
|
-
#define CR() renderer->cr(renderer)
|
19
|
-
#define BLANKLINE() renderer->blankline(renderer)
|
20
|
-
#define ENCODED_SIZE 20
|
21
|
-
#define LISTMARKER_SIZE 20
|
22
|
-
|
23
|
-
// Functions to convert cmark_nodes to commonmark strings.
|
24
|
-
|
25
|
-
static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_node *node,
|
26
|
-
cmark_escaping escape,
|
27
|
-
int32_t c, unsigned char nextc) {
|
28
|
-
bool needs_escaping = false;
|
29
|
-
bool follows_digit =
|
30
|
-
renderer->buffer->size > 0 &&
|
31
|
-
cmark_isdigit(renderer->buffer->ptr[renderer->buffer->size - 1]);
|
32
|
-
char encoded[ENCODED_SIZE];
|
33
|
-
|
34
|
-
needs_escaping =
|
35
|
-
c < 0x80 && escape != LITERAL &&
|
36
|
-
((escape == NORMAL &&
|
37
|
-
(c == '*' || c == '_' || c == '[' || c == ']' || c == '#' || c == '<' ||
|
38
|
-
c == '>' || c == '\\' || c == '`' || c == '!' ||
|
39
|
-
(c == '&' && cmark_isalpha(nextc)) || (c == '!' && nextc == '[') ||
|
40
|
-
(renderer->begin_content && (c == '-' || c == '+' || c == '=') &&
|
41
|
-
// begin_content doesn't get set to false til we've passed digits
|
42
|
-
// at the beginning of line, so...
|
43
|
-
!follows_digit) ||
|
44
|
-
(renderer->begin_content && (c == '.' || c == ')') && follows_digit &&
|
45
|
-
(nextc == 0 || cmark_isspace(nextc))))) ||
|
46
|
-
(escape == URL &&
|
47
|
-
(c == '`' || c == '<' || c == '>' || cmark_isspace((char)c) || c == '\\' ||
|
48
|
-
c == ')' || c == '(')) ||
|
49
|
-
(escape == TITLE &&
|
50
|
-
(c == '`' || c == '<' || c == '>' || c == '"' || c == '\\')));
|
51
|
-
|
52
|
-
if (needs_escaping) {
|
53
|
-
if (cmark_isspace((char)c)) {
|
54
|
-
// use percent encoding for spaces
|
55
|
-
snprintf(encoded, ENCODED_SIZE, "%%%2x", c);
|
56
|
-
cmark_strbuf_puts(renderer->buffer, encoded);
|
57
|
-
renderer->column += 3;
|
58
|
-
} else {
|
59
|
-
cmark_render_ascii(renderer, "\\");
|
60
|
-
cmark_render_code_point(renderer, c);
|
61
|
-
}
|
62
|
-
} else {
|
63
|
-
cmark_render_code_point(renderer, c);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
static int longest_backtick_sequence(const char *code) {
|
68
|
-
int longest = 0;
|
69
|
-
int current = 0;
|
70
|
-
size_t i = 0;
|
71
|
-
size_t code_len = strlen(code);
|
72
|
-
while (i <= code_len) {
|
73
|
-
if (code[i] == '`') {
|
74
|
-
current++;
|
75
|
-
} else {
|
76
|
-
if (current > longest) {
|
77
|
-
longest = current;
|
78
|
-
}
|
79
|
-
current = 0;
|
80
|
-
}
|
81
|
-
i++;
|
82
|
-
}
|
83
|
-
return longest;
|
84
|
-
}
|
85
|
-
|
86
|
-
static int shortest_unused_backtick_sequence(const char *code) {
|
87
|
-
// note: if the shortest sequence is >= 32, this returns 32
|
88
|
-
// so as not to overflow the bit array.
|
89
|
-
uint32_t used = 1;
|
90
|
-
int current = 0;
|
91
|
-
size_t i = 0;
|
92
|
-
size_t code_len = strlen(code);
|
93
|
-
while (i <= code_len) {
|
94
|
-
if (code[i] == '`') {
|
95
|
-
current++;
|
96
|
-
} else {
|
97
|
-
if (current > 0 && current < 32) {
|
98
|
-
used |= (1U << current);
|
99
|
-
}
|
100
|
-
current = 0;
|
101
|
-
}
|
102
|
-
i++;
|
103
|
-
}
|
104
|
-
// return number of first bit that is 0:
|
105
|
-
i = 0;
|
106
|
-
while (i < 32 && used & 1) {
|
107
|
-
used = used >> 1;
|
108
|
-
i++;
|
109
|
-
}
|
110
|
-
return (int)i;
|
111
|
-
}
|
112
|
-
|
113
|
-
static bool is_autolink(cmark_node *node) {
|
114
|
-
cmark_chunk *title;
|
115
|
-
cmark_chunk *url;
|
116
|
-
cmark_node *link_text;
|
117
|
-
char *realurl;
|
118
|
-
int realurllen;
|
119
|
-
|
120
|
-
if (node->type != CMARK_NODE_LINK) {
|
121
|
-
return false;
|
122
|
-
}
|
123
|
-
|
124
|
-
url = &node->as.link.url;
|
125
|
-
if (url->len == 0 || scan_scheme(url, 0) == 0) {
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
|
129
|
-
title = &node->as.link.title;
|
130
|
-
// if it has a title, we can't treat it as an autolink:
|
131
|
-
if (title->len > 0) {
|
132
|
-
return false;
|
133
|
-
}
|
134
|
-
|
135
|
-
link_text = node->first_child;
|
136
|
-
if (link_text == NULL) {
|
137
|
-
return false;
|
138
|
-
}
|
139
|
-
cmark_consolidate_text_nodes(link_text);
|
140
|
-
realurl = (char *)url->data;
|
141
|
-
realurllen = url->len;
|
142
|
-
if (strncmp(realurl, "mailto:", 7) == 0) {
|
143
|
-
realurl += 7;
|
144
|
-
realurllen -= 7;
|
145
|
-
}
|
146
|
-
return (realurllen == link_text->as.literal.len &&
|
147
|
-
strncmp(realurl, (char *)link_text->as.literal.data,
|
148
|
-
link_text->as.literal.len) == 0);
|
149
|
-
}
|
150
|
-
|
151
|
-
// if node is a block node, returns node.
|
152
|
-
// otherwise returns first block-level node that is an ancestor of node.
|
153
|
-
// if there is no block-level ancestor, returns NULL.
|
154
|
-
static cmark_node *get_containing_block(cmark_node *node) {
|
155
|
-
while (node) {
|
156
|
-
if (CMARK_NODE_BLOCK_P(node)) {
|
157
|
-
return node;
|
158
|
-
} else {
|
159
|
-
node = node->parent;
|
160
|
-
}
|
161
|
-
}
|
162
|
-
return NULL;
|
163
|
-
}
|
164
|
-
|
165
|
-
static int S_render_node(cmark_renderer *renderer, cmark_node *node,
|
166
|
-
cmark_event_type ev_type, int options) {
|
167
|
-
cmark_node *tmp;
|
168
|
-
int list_number;
|
169
|
-
cmark_delim_type list_delim;
|
170
|
-
int numticks;
|
171
|
-
int i;
|
172
|
-
bool entering = (ev_type == CMARK_EVENT_ENTER);
|
173
|
-
const char *info, *code, *title;
|
174
|
-
size_t info_len, code_len;
|
175
|
-
char listmarker[LISTMARKER_SIZE];
|
176
|
-
char *emph_delim;
|
177
|
-
bool first_in_list_item;
|
178
|
-
bufsize_t marker_width;
|
179
|
-
bool allow_wrap = renderer->width > 0 && !(CMARK_OPT_NOBREAKS & options) &&
|
180
|
-
!(CMARK_OPT_HARDBREAKS & options);
|
181
|
-
|
182
|
-
// Don't adjust tight list status til we've started the list.
|
183
|
-
// Otherwise we loose the blank line between a paragraph and
|
184
|
-
// a following list.
|
185
|
-
if (!(node->type == CMARK_NODE_ITEM && node->prev == NULL && entering)) {
|
186
|
-
tmp = get_containing_block(node);
|
187
|
-
renderer->in_tight_list_item =
|
188
|
-
tmp && // tmp might be NULL if there is no containing block
|
189
|
-
((tmp->type == CMARK_NODE_ITEM &&
|
190
|
-
cmark_node_get_list_tight(tmp->parent)) ||
|
191
|
-
(tmp && tmp->parent && tmp->parent->type == CMARK_NODE_ITEM &&
|
192
|
-
cmark_node_get_list_tight(tmp->parent->parent)));
|
193
|
-
}
|
194
|
-
|
195
|
-
if (node->extension && node->extension->commonmark_render_func) {
|
196
|
-
node->extension->commonmark_render_func(node->extension, renderer, node, ev_type, options);
|
197
|
-
return 1;
|
198
|
-
}
|
199
|
-
|
200
|
-
switch (node->type) {
|
201
|
-
case CMARK_NODE_DOCUMENT:
|
202
|
-
break;
|
203
|
-
|
204
|
-
case CMARK_NODE_BLOCK_QUOTE:
|
205
|
-
if (entering) {
|
206
|
-
LIT("> ");
|
207
|
-
renderer->begin_content = true;
|
208
|
-
cmark_strbuf_puts(renderer->prefix, "> ");
|
209
|
-
} else {
|
210
|
-
cmark_strbuf_truncate(renderer->prefix, renderer->prefix->size - 2);
|
211
|
-
BLANKLINE();
|
212
|
-
}
|
213
|
-
break;
|
214
|
-
|
215
|
-
case CMARK_NODE_LIST:
|
216
|
-
if (!entering && node->next && (node->next->type == CMARK_NODE_CODE_BLOCK ||
|
217
|
-
node->next->type == CMARK_NODE_LIST)) {
|
218
|
-
// this ensures that a following indented code block or list will be
|
219
|
-
// inteprereted correctly.
|
220
|
-
CR();
|
221
|
-
LIT("<!-- end list -->");
|
222
|
-
BLANKLINE();
|
223
|
-
}
|
224
|
-
break;
|
225
|
-
|
226
|
-
case CMARK_NODE_ITEM:
|
227
|
-
if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) {
|
228
|
-
marker_width = 4;
|
229
|
-
} else {
|
230
|
-
list_number = cmark_node_get_list_start(node->parent);
|
231
|
-
list_delim = cmark_node_get_list_delim(node->parent);
|
232
|
-
tmp = node;
|
233
|
-
while (tmp->prev) {
|
234
|
-
tmp = tmp->prev;
|
235
|
-
list_number += 1;
|
236
|
-
}
|
237
|
-
// we ensure a width of at least 4 so
|
238
|
-
// we get nice transition from single digits
|
239
|
-
// to double
|
240
|
-
snprintf(listmarker, LISTMARKER_SIZE, "%d%s%s", list_number,
|
241
|
-
list_delim == CMARK_PAREN_DELIM ? ")" : ".",
|
242
|
-
list_number < 10 ? " " : " ");
|
243
|
-
marker_width = (bufsize_t)strlen(listmarker);
|
244
|
-
}
|
245
|
-
if (entering) {
|
246
|
-
if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) {
|
247
|
-
LIT(" - ");
|
248
|
-
renderer->begin_content = true;
|
249
|
-
} else {
|
250
|
-
LIT(listmarker);
|
251
|
-
renderer->begin_content = true;
|
252
|
-
}
|
253
|
-
for (i = marker_width; i--;) {
|
254
|
-
cmark_strbuf_putc(renderer->prefix, ' ');
|
255
|
-
}
|
256
|
-
} else {
|
257
|
-
cmark_strbuf_truncate(renderer->prefix,
|
258
|
-
renderer->prefix->size - marker_width);
|
259
|
-
CR();
|
260
|
-
}
|
261
|
-
break;
|
262
|
-
|
263
|
-
case CMARK_NODE_HEADING:
|
264
|
-
if (entering) {
|
265
|
-
for (i = cmark_node_get_heading_level(node); i > 0; i--) {
|
266
|
-
LIT("#");
|
267
|
-
}
|
268
|
-
LIT(" ");
|
269
|
-
renderer->begin_content = true;
|
270
|
-
renderer->no_linebreaks = true;
|
271
|
-
} else {
|
272
|
-
renderer->no_linebreaks = false;
|
273
|
-
BLANKLINE();
|
274
|
-
}
|
275
|
-
break;
|
276
|
-
|
277
|
-
case CMARK_NODE_CODE_BLOCK:
|
278
|
-
first_in_list_item = node->prev == NULL && node->parent &&
|
279
|
-
node->parent->type == CMARK_NODE_ITEM;
|
280
|
-
|
281
|
-
if (!first_in_list_item) {
|
282
|
-
BLANKLINE();
|
283
|
-
}
|
284
|
-
info = cmark_node_get_fence_info(node);
|
285
|
-
info_len = strlen(info);
|
286
|
-
code = cmark_node_get_literal(node);
|
287
|
-
code_len = strlen(code);
|
288
|
-
// use indented form if no info, and code doesn't
|
289
|
-
// begin or end with a blank line, and code isn't
|
290
|
-
// first thing in a list item
|
291
|
-
if (info_len == 0 && (code_len > 2 && !cmark_isspace(code[0]) &&
|
292
|
-
!(cmark_isspace(code[code_len - 1]) &&
|
293
|
-
cmark_isspace(code[code_len - 2]))) &&
|
294
|
-
!first_in_list_item) {
|
295
|
-
LIT(" ");
|
296
|
-
cmark_strbuf_puts(renderer->prefix, " ");
|
297
|
-
OUT(cmark_node_get_literal(node), false, LITERAL);
|
298
|
-
cmark_strbuf_truncate(renderer->prefix, renderer->prefix->size - 4);
|
299
|
-
} else {
|
300
|
-
numticks = longest_backtick_sequence(code) + 1;
|
301
|
-
if (numticks < 3) {
|
302
|
-
numticks = 3;
|
303
|
-
}
|
304
|
-
for (i = 0; i < numticks; i++) {
|
305
|
-
LIT("`");
|
306
|
-
}
|
307
|
-
LIT(" ");
|
308
|
-
OUT(info, false, LITERAL);
|
309
|
-
CR();
|
310
|
-
OUT(cmark_node_get_literal(node), false, LITERAL);
|
311
|
-
CR();
|
312
|
-
for (i = 0; i < numticks; i++) {
|
313
|
-
LIT("`");
|
314
|
-
}
|
315
|
-
}
|
316
|
-
BLANKLINE();
|
317
|
-
break;
|
318
|
-
|
319
|
-
case CMARK_NODE_HTML_BLOCK:
|
320
|
-
BLANKLINE();
|
321
|
-
OUT(cmark_node_get_literal(node), false, LITERAL);
|
322
|
-
BLANKLINE();
|
323
|
-
break;
|
324
|
-
|
325
|
-
case CMARK_NODE_CUSTOM_BLOCK:
|
326
|
-
BLANKLINE();
|
327
|
-
OUT(entering ? cmark_node_get_on_enter(node) : cmark_node_get_on_exit(node),
|
328
|
-
false, LITERAL);
|
329
|
-
BLANKLINE();
|
330
|
-
break;
|
331
|
-
|
332
|
-
case CMARK_NODE_THEMATIC_BREAK:
|
333
|
-
BLANKLINE();
|
334
|
-
LIT("-----");
|
335
|
-
BLANKLINE();
|
336
|
-
break;
|
337
|
-
|
338
|
-
case CMARK_NODE_PARAGRAPH:
|
339
|
-
if (!entering) {
|
340
|
-
BLANKLINE();
|
341
|
-
}
|
342
|
-
break;
|
343
|
-
|
344
|
-
case CMARK_NODE_TEXT:
|
345
|
-
OUT(cmark_node_get_literal(node), allow_wrap, NORMAL);
|
346
|
-
break;
|
347
|
-
|
348
|
-
case CMARK_NODE_LINEBREAK:
|
349
|
-
if (!(CMARK_OPT_HARDBREAKS & options)) {
|
350
|
-
LIT(" ");
|
351
|
-
}
|
352
|
-
CR();
|
353
|
-
break;
|
354
|
-
|
355
|
-
case CMARK_NODE_SOFTBREAK:
|
356
|
-
if (CMARK_OPT_HARDBREAKS & options) {
|
357
|
-
LIT(" ");
|
358
|
-
CR();
|
359
|
-
} else if (!renderer->no_linebreaks && renderer->width == 0 &&
|
360
|
-
!(CMARK_OPT_HARDBREAKS & options) &&
|
361
|
-
!(CMARK_OPT_NOBREAKS & options)) {
|
362
|
-
CR();
|
363
|
-
} else {
|
364
|
-
OUT(" ", allow_wrap, LITERAL);
|
365
|
-
}
|
366
|
-
break;
|
367
|
-
|
368
|
-
case CMARK_NODE_CODE:
|
369
|
-
code = cmark_node_get_literal(node);
|
370
|
-
code_len = strlen(code);
|
371
|
-
numticks = shortest_unused_backtick_sequence(code);
|
372
|
-
for (i = 0; i < numticks; i++) {
|
373
|
-
LIT("`");
|
374
|
-
}
|
375
|
-
if (code_len == 0 || code[0] == '`') {
|
376
|
-
LIT(" ");
|
377
|
-
}
|
378
|
-
OUT(cmark_node_get_literal(node), allow_wrap, LITERAL);
|
379
|
-
if (code_len == 0 || code[code_len - 1] == '`') {
|
380
|
-
LIT(" ");
|
381
|
-
}
|
382
|
-
for (i = 0; i < numticks; i++) {
|
383
|
-
LIT("`");
|
384
|
-
}
|
385
|
-
break;
|
386
|
-
|
387
|
-
case CMARK_NODE_HTML_INLINE:
|
388
|
-
OUT(cmark_node_get_literal(node), false, LITERAL);
|
389
|
-
break;
|
390
|
-
|
391
|
-
case CMARK_NODE_CUSTOM_INLINE:
|
392
|
-
OUT(entering ? cmark_node_get_on_enter(node) : cmark_node_get_on_exit(node),
|
393
|
-
false, LITERAL);
|
394
|
-
break;
|
395
|
-
|
396
|
-
case CMARK_NODE_STRONG:
|
397
|
-
if (entering) {
|
398
|
-
LIT("**");
|
399
|
-
} else {
|
400
|
-
LIT("**");
|
401
|
-
}
|
402
|
-
break;
|
403
|
-
|
404
|
-
case CMARK_NODE_EMPH:
|
405
|
-
// If we have EMPH(EMPH(x)), we need to use *_x_*
|
406
|
-
// because **x** is STRONG(x):
|
407
|
-
if (node->parent && node->parent->type == CMARK_NODE_EMPH &&
|
408
|
-
node->next == NULL && node->prev == NULL) {
|
409
|
-
emph_delim = "_";
|
410
|
-
} else {
|
411
|
-
emph_delim = "*";
|
412
|
-
}
|
413
|
-
if (entering) {
|
414
|
-
LIT(emph_delim);
|
415
|
-
} else {
|
416
|
-
LIT(emph_delim);
|
417
|
-
}
|
418
|
-
break;
|
419
|
-
|
420
|
-
case CMARK_NODE_LINK:
|
421
|
-
if (is_autolink(node)) {
|
422
|
-
if (entering) {
|
423
|
-
LIT("<");
|
424
|
-
if (strncmp(cmark_node_get_url(node), "mailto:", 7) == 0) {
|
425
|
-
LIT((const char *)cmark_node_get_url(node) + 7);
|
426
|
-
} else {
|
427
|
-
LIT((const char *)cmark_node_get_url(node));
|
428
|
-
}
|
429
|
-
LIT(">");
|
430
|
-
// return signal to skip contents of node...
|
431
|
-
return 0;
|
432
|
-
}
|
433
|
-
} else {
|
434
|
-
if (entering) {
|
435
|
-
LIT("[");
|
436
|
-
} else {
|
437
|
-
LIT("](");
|
438
|
-
OUT(cmark_node_get_url(node), false, URL);
|
439
|
-
title = cmark_node_get_title(node);
|
440
|
-
if (strlen(title) > 0) {
|
441
|
-
LIT(" \"");
|
442
|
-
OUT(title, false, TITLE);
|
443
|
-
LIT("\"");
|
444
|
-
}
|
445
|
-
LIT(")");
|
446
|
-
}
|
447
|
-
}
|
448
|
-
break;
|
449
|
-
|
450
|
-
case CMARK_NODE_IMAGE:
|
451
|
-
if (entering) {
|
452
|
-
LIT("![");
|
453
|
-
} else {
|
454
|
-
LIT("](");
|
455
|
-
OUT(cmark_node_get_url(node), false, URL);
|
456
|
-
title = cmark_node_get_title(node);
|
457
|
-
if (strlen(title) > 0) {
|
458
|
-
OUT(" \"", allow_wrap, LITERAL);
|
459
|
-
OUT(title, false, TITLE);
|
460
|
-
LIT("\"");
|
461
|
-
}
|
462
|
-
LIT(")");
|
463
|
-
}
|
464
|
-
break;
|
465
|
-
|
466
|
-
case CMARK_NODE_FOOTNOTE_REFERENCE:
|
467
|
-
if (entering) {
|
468
|
-
LIT("[^");
|
469
|
-
OUT(cmark_chunk_to_cstr(renderer->mem, &node->as.literal), false, LITERAL);
|
470
|
-
LIT("]");
|
471
|
-
}
|
472
|
-
break;
|
473
|
-
|
474
|
-
case CMARK_NODE_FOOTNOTE_DEFINITION:
|
475
|
-
if (entering) {
|
476
|
-
renderer->footnote_ix += 1;
|
477
|
-
LIT("[^");
|
478
|
-
char n[32];
|
479
|
-
snprintf(n, sizeof(n), "%d", renderer->footnote_ix);
|
480
|
-
OUT(n, false, LITERAL);
|
481
|
-
LIT("]:\n");
|
482
|
-
|
483
|
-
cmark_strbuf_puts(renderer->prefix, " ");
|
484
|
-
} else {
|
485
|
-
cmark_strbuf_truncate(renderer->prefix, renderer->prefix->size - 4);
|
486
|
-
}
|
487
|
-
break;
|
488
|
-
|
489
|
-
default:
|
490
|
-
assert(false);
|
491
|
-
break;
|
492
|
-
}
|
493
|
-
|
494
|
-
return 1;
|
495
|
-
}
|
496
|
-
|
497
|
-
char *cmark_render_commonmark(cmark_node *root, int options, int width) {
|
498
|
-
return cmark_render_commonmark_with_mem(root, options, width, cmark_node_mem(root));
|
499
|
-
}
|
500
|
-
|
501
|
-
char *cmark_render_commonmark_with_mem(cmark_node *root, int options, int width, cmark_mem *mem) {
|
502
|
-
if (options & CMARK_OPT_HARDBREAKS) {
|
503
|
-
// disable breaking on width, since it has
|
504
|
-
// a different meaning with OPT_HARDBREAKS
|
505
|
-
width = 0;
|
506
|
-
}
|
507
|
-
return cmark_render(mem, root, options, width, outc, S_render_node);
|
508
|
-
}
|