commonmarker 0.17.6 → 0.17.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of commonmarker might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +0 -7
- data/ext/commonmarker/{cmark/src/arena.c → arena.c} +0 -0
- data/ext/commonmarker/{cmark/extensions/autolink.c → autolink.c} +0 -0
- data/ext/commonmarker/{cmark/extensions/autolink.h → autolink.h} +0 -0
- data/ext/commonmarker/{cmark/src/blocks.c → blocks.c} +0 -0
- data/ext/commonmarker/{cmark/src/buffer.c → buffer.c} +0 -0
- data/ext/commonmarker/{cmark/src/buffer.h → buffer.h} +0 -0
- data/ext/commonmarker/{cmark/src/case_fold_switch.inc → case_fold_switch.inc} +0 -0
- data/ext/commonmarker/{cmark/src/chunk.h → chunk.h} +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/CMakeLists.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/COPYING +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/FindAsan.cmake +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/Makefile +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/Makefile.nmake +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/README.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/CMakeLists.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/cplusplus.cpp +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/cplusplus.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/harness.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/harness.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/api_test/main.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/appveyor.yml +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-bq-flat.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-bq-nested.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-code.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-fences.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-heading.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-hr.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-html.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-lheading.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-list-flat.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-list-nested.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-ref-flat.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/block-ref-nested.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-autolink.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-backticks.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-flat.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-nested.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-em-worst.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-entity.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-escape.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-html.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-links-flat.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-links-nested.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/inline-newlines.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/lorem1.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/samples/rawtabs.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/statistics.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/bench/stats.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/benchmarks.md +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +478 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +71 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +73 -0
- 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 +15 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +567 -0
- 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 +539 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +18 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +709 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +157 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +391 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +48 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +1 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +34 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +405 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +11 -0
- data/ext/commonmarker/cmark-upstream/build/Makefile +280 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +134 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +38 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +38 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +169 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +12 -0
- 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 +28 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +28 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +17 -0
- 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 +1 -0
- 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 +5 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +302 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +29 -0
- data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +49 -0
- data/ext/commonmarker/cmark-upstream/build/compile_commands.json +352 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +30 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +108 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +246 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +36 -0
- 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 +253 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +16 -0
- 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 +96 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +96 -0
- 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 +10 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +1 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +8 -0
- 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 +246 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +29 -0
- 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 +249 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +15 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +3 -0
- 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 +96 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +96 -0
- 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 +10 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +2 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +8 -0
- 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 +1 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +426 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +84 -0
- data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +42 -0
- 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 +1 -0
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark-upstream/build/man/Makefile +196 -0
- data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +37 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +38 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +95 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +156 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +30 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +115 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +10 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +20 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +20 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +10 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +1 -0
- 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 +3 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +612 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +60 -0
- 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 +819 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +37 -0
- 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 +319 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +319 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +10 -0
- 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 +1 -0
- 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 +29 -0
- 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 +612 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +54 -0
- 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 +816 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +36 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +3 -0
- 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 +319 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +319 -0
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +10 -0
- 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 +2 -0
- 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 +29 -0
- 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 +1 -0
- data/ext/commonmarker/cmark-upstream/build/src/Makefile +1165 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +97 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +42 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +8 -0
- data/ext/commonmarker/cmark-upstream/build/src/config.h +76 -0
- 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 +1 -0
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +10 -0
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +17 -0
- data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +196 -0
- data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +29 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/changelog.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/data/CaseFolding.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/CMakeLists.txt +0 -0
- data/ext/commonmarker/cmark-upstream/extensions/autolink.c +421 -0
- data/ext/commonmarker/cmark-upstream/extensions/autolink.h +8 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/core-extensions.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/core-extensions.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/ext_scanners.re +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/strikethrough.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/strikethrough.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/table.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/table.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/tagfilter.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/extensions/tagfilter.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/man/CMakeLists.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/man/make_man_page.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/man/man1/cmark-gfm.1 +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/man/man3/cmark-gfm.3 +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/nmake.bat +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/CMakeLists.txt +0 -0
- data/ext/commonmarker/cmark-upstream/src/arena.c +103 -0
- data/ext/commonmarker/cmark-upstream/src/blocks.c +1519 -0
- data/ext/commonmarker/cmark-upstream/src/buffer.c +279 -0
- data/ext/commonmarker/cmark-upstream/src/buffer.h +116 -0
- data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +4327 -0
- data/ext/commonmarker/cmark-upstream/src/chunk.h +136 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_ctype.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_ctype.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_extension_api.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/cmark_version.h.in +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/commonmark.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/config.h.in +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/entities.inc +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/footnotes.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/footnotes.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_href_e.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_html_e.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/houdini_html_u.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/html.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/html.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/inlines.c +8 -4
- data/ext/commonmarker/{cmark → cmark-upstream}/src/inlines.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/iterator.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/iterator.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/latex.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/libcmark-gfm.pc.in +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/linked_list.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/main.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/man.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/map.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/map.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/node.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/node.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/parser.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/plaintext.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/plugin.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/plugin.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/references.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/references.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/registry.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/registry.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/render.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/render.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/scanners.re +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/syntax_extension.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/syntax_extension.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/utf8.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/utf8.h +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/src/xml.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/suppressions +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/CMakeLists.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/afl_test_cases/test.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/cmark-fuzz.c +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/cmark.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/entity_tests.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/extensions.txt +2 -2
- data/ext/commonmarker/{cmark → cmark-upstream}/test/fuzzing_dictionary +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/normalize.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/pathological_tests.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/regression.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/roundtrip_tests.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/run-cmark-fuzz +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/smart_punct.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/spec.txt +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/test/spec_tests.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/toolchain-mingw32.cmake +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/tools/Dockerfile +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/tools/appveyor-build.bat +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/tools/make_entities_inc.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/tools/mkcasefold.pl +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/why-cmark-and-not-x.md +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.js +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.py +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.rb +0 -0
- data/ext/commonmarker/{cmark → cmark-upstream}/wrappers/wrapper.rkt +0 -0
- data/ext/commonmarker/cmark.c +55 -0
- data/ext/commonmarker/cmark.h +789 -0
- data/ext/commonmarker/cmark_ctype.c +44 -0
- data/ext/commonmarker/cmark_ctype.h +33 -0
- data/ext/commonmarker/cmark_export.h +42 -0
- data/ext/commonmarker/cmark_extension_api.h +719 -0
- data/ext/commonmarker/cmark_version.h +8 -0
- data/ext/commonmarker/cmarkextensions_export.h +42 -0
- data/ext/commonmarker/commonmark.c +508 -0
- data/ext/commonmarker/config.h +76 -0
- data/ext/commonmarker/core-extensions.c +25 -0
- data/ext/commonmarker/core-extensions.h +25 -0
- data/ext/commonmarker/entities.inc +2138 -0
- data/ext/commonmarker/ext_scanners.c +941 -0
- data/ext/commonmarker/ext_scanners.h +22 -0
- data/ext/commonmarker/extconf.rb +1 -48
- data/ext/commonmarker/footnotes.c +40 -0
- data/ext/commonmarker/footnotes.h +25 -0
- data/ext/commonmarker/houdini.h +57 -0
- data/ext/commonmarker/houdini_href_e.c +100 -0
- data/ext/commonmarker/houdini_html_e.c +66 -0
- data/ext/commonmarker/houdini_html_u.c +149 -0
- data/ext/commonmarker/html.c +457 -0
- data/ext/commonmarker/html.h +27 -0
- data/ext/commonmarker/inlines.c +1594 -0
- data/ext/commonmarker/inlines.h +29 -0
- data/ext/commonmarker/iterator.c +159 -0
- data/ext/commonmarker/iterator.h +27 -0
- data/ext/commonmarker/latex.c +466 -0
- data/ext/commonmarker/linked_list.c +37 -0
- data/ext/commonmarker/man.c +278 -0
- data/ext/commonmarker/map.c +122 -0
- data/ext/commonmarker/map.h +42 -0
- data/ext/commonmarker/node.c +965 -0
- data/ext/commonmarker/node.h +116 -0
- data/ext/commonmarker/parser.h +57 -0
- data/ext/commonmarker/plaintext.c +213 -0
- data/ext/commonmarker/plugin.c +36 -0
- data/ext/commonmarker/plugin.h +34 -0
- data/ext/commonmarker/references.c +42 -0
- data/ext/commonmarker/references.h +26 -0
- data/ext/commonmarker/registry.c +63 -0
- data/ext/commonmarker/registry.h +24 -0
- data/ext/commonmarker/render.c +202 -0
- data/ext/commonmarker/render.h +63 -0
- data/ext/commonmarker/scanners.c +18195 -0
- data/ext/commonmarker/scanners.h +64 -0
- data/ext/commonmarker/scanners.re +341 -0
- data/ext/commonmarker/strikethrough.c +157 -0
- data/ext/commonmarker/strikethrough.h +9 -0
- data/ext/commonmarker/syntax_extension.c +139 -0
- data/ext/commonmarker/syntax_extension.h +32 -0
- data/ext/commonmarker/table.c +683 -0
- data/ext/commonmarker/table.h +8 -0
- data/ext/commonmarker/tagfilter.c +60 -0
- data/ext/commonmarker/tagfilter.h +8 -0
- data/ext/commonmarker/utf8.c +317 -0
- data/ext/commonmarker/utf8.h +35 -0
- data/ext/commonmarker/xml.c +174 -0
- data/lib/commonmarker/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +401 -145
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
#ifndef CMARKEXTENSIONS_EXPORT_H
|
3
|
+
#define CMARKEXTENSIONS_EXPORT_H
|
4
|
+
|
5
|
+
#ifdef CMARKEXTENSIONS_STATIC_DEFINE
|
6
|
+
# define CMARKEXTENSIONS_EXPORT
|
7
|
+
# define CMARKEXTENSIONS_NO_EXPORT
|
8
|
+
#else
|
9
|
+
# ifndef CMARKEXTENSIONS_EXPORT
|
10
|
+
# ifdef libcmark_gfmextensions_EXPORTS
|
11
|
+
/* We are building this library */
|
12
|
+
# define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
|
13
|
+
# else
|
14
|
+
/* We are using this library */
|
15
|
+
# define CMARKEXTENSIONS_EXPORT __attribute__((visibility("default")))
|
16
|
+
# endif
|
17
|
+
# endif
|
18
|
+
|
19
|
+
# ifndef CMARKEXTENSIONS_NO_EXPORT
|
20
|
+
# define CMARKEXTENSIONS_NO_EXPORT __attribute__((visibility("hidden")))
|
21
|
+
# endif
|
22
|
+
#endif
|
23
|
+
|
24
|
+
#ifndef CMARKEXTENSIONS_DEPRECATED
|
25
|
+
# define CMARKEXTENSIONS_DEPRECATED __attribute__ ((__deprecated__))
|
26
|
+
#endif
|
27
|
+
|
28
|
+
#ifndef CMARKEXTENSIONS_DEPRECATED_EXPORT
|
29
|
+
# define CMARKEXTENSIONS_DEPRECATED_EXPORT CMARKEXTENSIONS_EXPORT CMARKEXTENSIONS_DEPRECATED
|
30
|
+
#endif
|
31
|
+
|
32
|
+
#ifndef CMARKEXTENSIONS_DEPRECATED_NO_EXPORT
|
33
|
+
# define CMARKEXTENSIONS_DEPRECATED_NO_EXPORT CMARKEXTENSIONS_NO_EXPORT CMARKEXTENSIONS_DEPRECATED
|
34
|
+
#endif
|
35
|
+
|
36
|
+
#if 0 /* DEFINE_NO_DEPRECATED */
|
37
|
+
# ifndef CMARKEXTENSIONS_NO_DEPRECATED
|
38
|
+
# define CMARKEXTENSIONS_NO_DEPRECATED
|
39
|
+
# endif
|
40
|
+
#endif
|
41
|
+
|
42
|
+
#endif
|
@@ -0,0 +1,508 @@
|
|
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
|
+
}
|