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,457 @@
|
|
1
|
+
#include <stdlib.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <string.h>
|
4
|
+
#include <assert.h>
|
5
|
+
#include "cmark_ctype.h"
|
6
|
+
#include "config.h"
|
7
|
+
#include "cmark.h"
|
8
|
+
#include "houdini.h"
|
9
|
+
#include "scanners.h"
|
10
|
+
#include "syntax_extension.h"
|
11
|
+
#include "html.h"
|
12
|
+
#include "render.h"
|
13
|
+
|
14
|
+
// Functions to convert cmark_nodes to HTML strings.
|
15
|
+
|
16
|
+
static void escape_html(cmark_strbuf *dest, const unsigned char *source,
|
17
|
+
bufsize_t length) {
|
18
|
+
houdini_escape_html0(dest, source, length, 0);
|
19
|
+
}
|
20
|
+
|
21
|
+
static void filter_html_block(cmark_html_renderer *renderer, uint8_t *data, size_t len) {
|
22
|
+
cmark_strbuf *html = renderer->html;
|
23
|
+
cmark_llist *it;
|
24
|
+
cmark_syntax_extension *ext;
|
25
|
+
bool filtered;
|
26
|
+
uint8_t *match;
|
27
|
+
|
28
|
+
while (len) {
|
29
|
+
match = (uint8_t *) memchr(data, '<', len);
|
30
|
+
if (!match)
|
31
|
+
break;
|
32
|
+
|
33
|
+
if (match != data) {
|
34
|
+
cmark_strbuf_put(html, data, (bufsize_t)(match - data));
|
35
|
+
len -= (match - data);
|
36
|
+
data = match;
|
37
|
+
}
|
38
|
+
|
39
|
+
filtered = false;
|
40
|
+
for (it = renderer->filter_extensions; it; it = it->next) {
|
41
|
+
ext = ((cmark_syntax_extension *) it->data);
|
42
|
+
if (!ext->html_filter_func(ext, data, len)) {
|
43
|
+
filtered = true;
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
if (!filtered) {
|
49
|
+
cmark_strbuf_putc(html, '<');
|
50
|
+
} else {
|
51
|
+
cmark_strbuf_puts(html, "<");
|
52
|
+
}
|
53
|
+
|
54
|
+
++data;
|
55
|
+
--len;
|
56
|
+
}
|
57
|
+
|
58
|
+
if (len)
|
59
|
+
cmark_strbuf_put(html, data, (bufsize_t)len);
|
60
|
+
}
|
61
|
+
|
62
|
+
static bool S_put_footnote_backref(cmark_html_renderer *renderer, cmark_strbuf *html) {
|
63
|
+
if (renderer->written_footnote_ix >= renderer->footnote_ix)
|
64
|
+
return false;
|
65
|
+
renderer->written_footnote_ix = renderer->footnote_ix;
|
66
|
+
|
67
|
+
cmark_strbuf_puts(html, "<a href=\"#fnref");
|
68
|
+
char n[32];
|
69
|
+
snprintf(n, sizeof(n), "%d", renderer->footnote_ix);
|
70
|
+
cmark_strbuf_puts(html, n);
|
71
|
+
cmark_strbuf_puts(html, "\" class=\"footnote-backref\">↩</a>");
|
72
|
+
|
73
|
+
return true;
|
74
|
+
}
|
75
|
+
|
76
|
+
static int S_render_node(cmark_html_renderer *renderer, cmark_node *node,
|
77
|
+
cmark_event_type ev_type, int options) {
|
78
|
+
cmark_node *parent;
|
79
|
+
cmark_node *grandparent;
|
80
|
+
cmark_strbuf *html = renderer->html;
|
81
|
+
cmark_llist *it;
|
82
|
+
cmark_syntax_extension *ext;
|
83
|
+
char start_heading[] = "<h0";
|
84
|
+
char end_heading[] = "</h0";
|
85
|
+
bool tight;
|
86
|
+
bool filtered;
|
87
|
+
char buffer[BUFFER_SIZE];
|
88
|
+
|
89
|
+
bool entering = (ev_type == CMARK_EVENT_ENTER);
|
90
|
+
|
91
|
+
if (renderer->plain == node) { // back at original node
|
92
|
+
renderer->plain = NULL;
|
93
|
+
}
|
94
|
+
|
95
|
+
if (renderer->plain != NULL) {
|
96
|
+
switch (node->type) {
|
97
|
+
case CMARK_NODE_TEXT:
|
98
|
+
case CMARK_NODE_CODE:
|
99
|
+
case CMARK_NODE_HTML_INLINE:
|
100
|
+
escape_html(html, node->as.literal.data, node->as.literal.len);
|
101
|
+
break;
|
102
|
+
|
103
|
+
case CMARK_NODE_LINEBREAK:
|
104
|
+
case CMARK_NODE_SOFTBREAK:
|
105
|
+
cmark_strbuf_putc(html, ' ');
|
106
|
+
break;
|
107
|
+
|
108
|
+
default:
|
109
|
+
break;
|
110
|
+
}
|
111
|
+
return 1;
|
112
|
+
}
|
113
|
+
|
114
|
+
if (node->extension && node->extension->html_render_func) {
|
115
|
+
node->extension->html_render_func(node->extension, renderer, node, ev_type, options);
|
116
|
+
return 1;
|
117
|
+
}
|
118
|
+
|
119
|
+
switch (node->type) {
|
120
|
+
case CMARK_NODE_DOCUMENT:
|
121
|
+
break;
|
122
|
+
|
123
|
+
case CMARK_NODE_BLOCK_QUOTE:
|
124
|
+
if (entering) {
|
125
|
+
cmark_html_render_cr(html);
|
126
|
+
cmark_strbuf_puts(html, "<blockquote");
|
127
|
+
cmark_html_render_sourcepos(node, html, options);
|
128
|
+
cmark_strbuf_puts(html, ">\n");
|
129
|
+
} else {
|
130
|
+
cmark_html_render_cr(html);
|
131
|
+
cmark_strbuf_puts(html, "</blockquote>\n");
|
132
|
+
}
|
133
|
+
break;
|
134
|
+
|
135
|
+
case CMARK_NODE_LIST: {
|
136
|
+
cmark_list_type list_type = node->as.list.list_type;
|
137
|
+
int start = node->as.list.start;
|
138
|
+
|
139
|
+
if (entering) {
|
140
|
+
cmark_html_render_cr(html);
|
141
|
+
if (list_type == CMARK_BULLET_LIST) {
|
142
|
+
cmark_strbuf_puts(html, "<ul");
|
143
|
+
cmark_html_render_sourcepos(node, html, options);
|
144
|
+
cmark_strbuf_puts(html, ">\n");
|
145
|
+
} else if (start == 1) {
|
146
|
+
cmark_strbuf_puts(html, "<ol");
|
147
|
+
cmark_html_render_sourcepos(node, html, options);
|
148
|
+
cmark_strbuf_puts(html, ">\n");
|
149
|
+
} else {
|
150
|
+
snprintf(buffer, BUFFER_SIZE, "<ol start=\"%d\"", start);
|
151
|
+
cmark_strbuf_puts(html, buffer);
|
152
|
+
cmark_html_render_sourcepos(node, html, options);
|
153
|
+
cmark_strbuf_puts(html, ">\n");
|
154
|
+
}
|
155
|
+
} else {
|
156
|
+
cmark_strbuf_puts(html,
|
157
|
+
list_type == CMARK_BULLET_LIST ? "</ul>\n" : "</ol>\n");
|
158
|
+
}
|
159
|
+
break;
|
160
|
+
}
|
161
|
+
|
162
|
+
case CMARK_NODE_ITEM:
|
163
|
+
if (entering) {
|
164
|
+
cmark_html_render_cr(html);
|
165
|
+
cmark_strbuf_puts(html, "<li");
|
166
|
+
cmark_html_render_sourcepos(node, html, options);
|
167
|
+
cmark_strbuf_putc(html, '>');
|
168
|
+
} else {
|
169
|
+
cmark_strbuf_puts(html, "</li>\n");
|
170
|
+
}
|
171
|
+
break;
|
172
|
+
|
173
|
+
case CMARK_NODE_HEADING:
|
174
|
+
if (entering) {
|
175
|
+
cmark_html_render_cr(html);
|
176
|
+
start_heading[2] = (char)('0' + node->as.heading.level);
|
177
|
+
cmark_strbuf_puts(html, start_heading);
|
178
|
+
cmark_html_render_sourcepos(node, html, options);
|
179
|
+
cmark_strbuf_putc(html, '>');
|
180
|
+
} else {
|
181
|
+
end_heading[3] = (char)('0' + node->as.heading.level);
|
182
|
+
cmark_strbuf_puts(html, end_heading);
|
183
|
+
cmark_strbuf_puts(html, ">\n");
|
184
|
+
}
|
185
|
+
break;
|
186
|
+
|
187
|
+
case CMARK_NODE_CODE_BLOCK:
|
188
|
+
cmark_html_render_cr(html);
|
189
|
+
|
190
|
+
if (node->as.code.info.len == 0) {
|
191
|
+
cmark_strbuf_puts(html, "<pre");
|
192
|
+
cmark_html_render_sourcepos(node, html, options);
|
193
|
+
cmark_strbuf_puts(html, "><code>");
|
194
|
+
} else {
|
195
|
+
bufsize_t first_tag = 0;
|
196
|
+
while (first_tag < node->as.code.info.len &&
|
197
|
+
!cmark_isspace(node->as.code.info.data[first_tag])) {
|
198
|
+
first_tag += 1;
|
199
|
+
}
|
200
|
+
|
201
|
+
if (options & CMARK_OPT_GITHUB_PRE_LANG) {
|
202
|
+
cmark_strbuf_puts(html, "<pre");
|
203
|
+
cmark_html_render_sourcepos(node, html, options);
|
204
|
+
cmark_strbuf_puts(html, " lang=\"");
|
205
|
+
escape_html(html, node->as.code.info.data, first_tag);
|
206
|
+
cmark_strbuf_puts(html, "\"><code>");
|
207
|
+
} else {
|
208
|
+
cmark_strbuf_puts(html, "<pre");
|
209
|
+
cmark_html_render_sourcepos(node, html, options);
|
210
|
+
cmark_strbuf_puts(html, "><code class=\"language-");
|
211
|
+
escape_html(html, node->as.code.info.data, first_tag);
|
212
|
+
cmark_strbuf_puts(html, "\">");
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
escape_html(html, node->as.code.literal.data, node->as.code.literal.len);
|
217
|
+
cmark_strbuf_puts(html, "</code></pre>\n");
|
218
|
+
break;
|
219
|
+
|
220
|
+
case CMARK_NODE_HTML_BLOCK:
|
221
|
+
cmark_html_render_cr(html);
|
222
|
+
if (options & CMARK_OPT_SAFE) {
|
223
|
+
cmark_strbuf_puts(html, "<!-- raw HTML omitted -->");
|
224
|
+
} else if (renderer->filter_extensions) {
|
225
|
+
filter_html_block(renderer, node->as.literal.data, node->as.literal.len);
|
226
|
+
} else {
|
227
|
+
cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
|
228
|
+
}
|
229
|
+
cmark_html_render_cr(html);
|
230
|
+
break;
|
231
|
+
|
232
|
+
case CMARK_NODE_CUSTOM_BLOCK:
|
233
|
+
cmark_html_render_cr(html);
|
234
|
+
if (entering) {
|
235
|
+
cmark_strbuf_put(html, node->as.custom.on_enter.data,
|
236
|
+
node->as.custom.on_enter.len);
|
237
|
+
} else {
|
238
|
+
cmark_strbuf_put(html, node->as.custom.on_exit.data,
|
239
|
+
node->as.custom.on_exit.len);
|
240
|
+
}
|
241
|
+
cmark_html_render_cr(html);
|
242
|
+
break;
|
243
|
+
|
244
|
+
case CMARK_NODE_THEMATIC_BREAK:
|
245
|
+
cmark_html_render_cr(html);
|
246
|
+
cmark_strbuf_puts(html, "<hr");
|
247
|
+
cmark_html_render_sourcepos(node, html, options);
|
248
|
+
cmark_strbuf_puts(html, " />\n");
|
249
|
+
break;
|
250
|
+
|
251
|
+
case CMARK_NODE_PARAGRAPH:
|
252
|
+
parent = cmark_node_parent(node);
|
253
|
+
grandparent = cmark_node_parent(parent);
|
254
|
+
if (grandparent != NULL && grandparent->type == CMARK_NODE_LIST) {
|
255
|
+
tight = grandparent->as.list.tight;
|
256
|
+
} else {
|
257
|
+
tight = false;
|
258
|
+
}
|
259
|
+
if (!tight) {
|
260
|
+
if (entering) {
|
261
|
+
cmark_html_render_cr(html);
|
262
|
+
cmark_strbuf_puts(html, "<p");
|
263
|
+
cmark_html_render_sourcepos(node, html, options);
|
264
|
+
cmark_strbuf_putc(html, '>');
|
265
|
+
} else {
|
266
|
+
if (parent->type == CMARK_NODE_FOOTNOTE_DEFINITION && node->next == NULL) {
|
267
|
+
cmark_strbuf_putc(html, ' ');
|
268
|
+
S_put_footnote_backref(renderer, html);
|
269
|
+
}
|
270
|
+
cmark_strbuf_puts(html, "</p>\n");
|
271
|
+
}
|
272
|
+
}
|
273
|
+
break;
|
274
|
+
|
275
|
+
case CMARK_NODE_TEXT:
|
276
|
+
escape_html(html, node->as.literal.data, node->as.literal.len);
|
277
|
+
break;
|
278
|
+
|
279
|
+
case CMARK_NODE_LINEBREAK:
|
280
|
+
cmark_strbuf_puts(html, "<br />\n");
|
281
|
+
break;
|
282
|
+
|
283
|
+
case CMARK_NODE_SOFTBREAK:
|
284
|
+
if (options & CMARK_OPT_HARDBREAKS) {
|
285
|
+
cmark_strbuf_puts(html, "<br />\n");
|
286
|
+
} else if (options & CMARK_OPT_NOBREAKS) {
|
287
|
+
cmark_strbuf_putc(html, ' ');
|
288
|
+
} else {
|
289
|
+
cmark_strbuf_putc(html, '\n');
|
290
|
+
}
|
291
|
+
break;
|
292
|
+
|
293
|
+
case CMARK_NODE_CODE:
|
294
|
+
cmark_strbuf_puts(html, "<code>");
|
295
|
+
escape_html(html, node->as.literal.data, node->as.literal.len);
|
296
|
+
cmark_strbuf_puts(html, "</code>");
|
297
|
+
break;
|
298
|
+
|
299
|
+
case CMARK_NODE_HTML_INLINE:
|
300
|
+
if (options & CMARK_OPT_SAFE) {
|
301
|
+
cmark_strbuf_puts(html, "<!-- raw HTML omitted -->");
|
302
|
+
} else {
|
303
|
+
filtered = false;
|
304
|
+
for (it = renderer->filter_extensions; it; it = it->next) {
|
305
|
+
ext = (cmark_syntax_extension *) it->data;
|
306
|
+
if (!ext->html_filter_func(ext, node->as.literal.data, node->as.literal.len)) {
|
307
|
+
filtered = true;
|
308
|
+
break;
|
309
|
+
}
|
310
|
+
}
|
311
|
+
if (!filtered) {
|
312
|
+
cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
|
313
|
+
} else {
|
314
|
+
cmark_strbuf_puts(html, "<");
|
315
|
+
cmark_strbuf_put(html, node->as.literal.data + 1, node->as.literal.len - 1);
|
316
|
+
}
|
317
|
+
}
|
318
|
+
break;
|
319
|
+
|
320
|
+
case CMARK_NODE_CUSTOM_INLINE:
|
321
|
+
if (entering) {
|
322
|
+
cmark_strbuf_put(html, node->as.custom.on_enter.data,
|
323
|
+
node->as.custom.on_enter.len);
|
324
|
+
} else {
|
325
|
+
cmark_strbuf_put(html, node->as.custom.on_exit.data,
|
326
|
+
node->as.custom.on_exit.len);
|
327
|
+
}
|
328
|
+
break;
|
329
|
+
|
330
|
+
case CMARK_NODE_STRONG:
|
331
|
+
if (entering) {
|
332
|
+
cmark_strbuf_puts(html, "<strong>");
|
333
|
+
} else {
|
334
|
+
cmark_strbuf_puts(html, "</strong>");
|
335
|
+
}
|
336
|
+
break;
|
337
|
+
|
338
|
+
case CMARK_NODE_EMPH:
|
339
|
+
if (entering) {
|
340
|
+
cmark_strbuf_puts(html, "<em>");
|
341
|
+
} else {
|
342
|
+
cmark_strbuf_puts(html, "</em>");
|
343
|
+
}
|
344
|
+
break;
|
345
|
+
|
346
|
+
case CMARK_NODE_LINK:
|
347
|
+
if (entering) {
|
348
|
+
cmark_strbuf_puts(html, "<a href=\"");
|
349
|
+
if (!((options & CMARK_OPT_SAFE) &&
|
350
|
+
scan_dangerous_url(&node->as.link.url, 0))) {
|
351
|
+
houdini_escape_href(html, node->as.link.url.data,
|
352
|
+
node->as.link.url.len);
|
353
|
+
}
|
354
|
+
if (node->as.link.title.len) {
|
355
|
+
cmark_strbuf_puts(html, "\" title=\"");
|
356
|
+
escape_html(html, node->as.link.title.data, node->as.link.title.len);
|
357
|
+
}
|
358
|
+
cmark_strbuf_puts(html, "\">");
|
359
|
+
} else {
|
360
|
+
cmark_strbuf_puts(html, "</a>");
|
361
|
+
}
|
362
|
+
break;
|
363
|
+
|
364
|
+
case CMARK_NODE_IMAGE:
|
365
|
+
if (entering) {
|
366
|
+
cmark_strbuf_puts(html, "<img src=\"");
|
367
|
+
if (!((options & CMARK_OPT_SAFE) &&
|
368
|
+
scan_dangerous_url(&node->as.link.url, 0))) {
|
369
|
+
houdini_escape_href(html, node->as.link.url.data,
|
370
|
+
node->as.link.url.len);
|
371
|
+
}
|
372
|
+
cmark_strbuf_puts(html, "\" alt=\"");
|
373
|
+
renderer->plain = node;
|
374
|
+
} else {
|
375
|
+
if (node->as.link.title.len) {
|
376
|
+
cmark_strbuf_puts(html, "\" title=\"");
|
377
|
+
escape_html(html, node->as.link.title.data, node->as.link.title.len);
|
378
|
+
}
|
379
|
+
|
380
|
+
cmark_strbuf_puts(html, "\" />");
|
381
|
+
}
|
382
|
+
break;
|
383
|
+
|
384
|
+
case CMARK_NODE_FOOTNOTE_DEFINITION:
|
385
|
+
if (entering) {
|
386
|
+
if (renderer->footnote_ix == 0) {
|
387
|
+
cmark_strbuf_puts(html, "<section class=\"footnotes\">\n<ol>\n");
|
388
|
+
}
|
389
|
+
++renderer->footnote_ix;
|
390
|
+
cmark_strbuf_puts(html, "<li id=\"fn");
|
391
|
+
char n[32];
|
392
|
+
snprintf(n, sizeof(n), "%d", renderer->footnote_ix);
|
393
|
+
cmark_strbuf_puts(html, n);
|
394
|
+
cmark_strbuf_puts(html, "\">\n");
|
395
|
+
} else {
|
396
|
+
if (S_put_footnote_backref(renderer, html)) {
|
397
|
+
cmark_strbuf_putc(html, '\n');
|
398
|
+
}
|
399
|
+
cmark_strbuf_puts(html, "</li>\n");
|
400
|
+
}
|
401
|
+
break;
|
402
|
+
|
403
|
+
case CMARK_NODE_FOOTNOTE_REFERENCE:
|
404
|
+
if (entering) {
|
405
|
+
cmark_strbuf_puts(html, "<sup class=\"footnote-ref\"><a href=\"#fn");
|
406
|
+
cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
|
407
|
+
cmark_strbuf_puts(html, "\" id=\"fnref");
|
408
|
+
cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
|
409
|
+
cmark_strbuf_puts(html, "\">[");
|
410
|
+
cmark_strbuf_put(html, node->as.literal.data, node->as.literal.len);
|
411
|
+
cmark_strbuf_puts(html, "]</a></sup>");
|
412
|
+
}
|
413
|
+
break;
|
414
|
+
|
415
|
+
default:
|
416
|
+
assert(false);
|
417
|
+
break;
|
418
|
+
}
|
419
|
+
|
420
|
+
return 1;
|
421
|
+
}
|
422
|
+
|
423
|
+
char *cmark_render_html(cmark_node *root, int options, cmark_llist *extensions) {
|
424
|
+
return cmark_render_html_with_mem(root, options, extensions, cmark_node_mem(root));
|
425
|
+
}
|
426
|
+
|
427
|
+
char *cmark_render_html_with_mem(cmark_node *root, int options, cmark_llist *extensions, cmark_mem *mem) {
|
428
|
+
char *result;
|
429
|
+
cmark_strbuf html = CMARK_BUF_INIT(mem);
|
430
|
+
cmark_event_type ev_type;
|
431
|
+
cmark_node *cur;
|
432
|
+
cmark_html_renderer renderer = {&html, NULL, NULL, 0, 0, NULL};
|
433
|
+
cmark_iter *iter = cmark_iter_new(root);
|
434
|
+
|
435
|
+
for (; extensions; extensions = extensions->next)
|
436
|
+
if (((cmark_syntax_extension *) extensions->data)->html_filter_func)
|
437
|
+
renderer.filter_extensions = cmark_llist_append(
|
438
|
+
mem,
|
439
|
+
renderer.filter_extensions,
|
440
|
+
(cmark_syntax_extension *) extensions->data);
|
441
|
+
|
442
|
+
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
|
443
|
+
cur = cmark_iter_get_node(iter);
|
444
|
+
S_render_node(&renderer, cur, ev_type, options);
|
445
|
+
}
|
446
|
+
|
447
|
+
if (renderer.footnote_ix) {
|
448
|
+
cmark_strbuf_puts(&html, "</ol>\n</section>\n");
|
449
|
+
}
|
450
|
+
|
451
|
+
result = (char *)cmark_strbuf_detach(&html);
|
452
|
+
|
453
|
+
cmark_llist_free(mem, renderer.filter_extensions);
|
454
|
+
|
455
|
+
cmark_iter_free(iter);
|
456
|
+
return result;
|
457
|
+
}
|