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,22 @@
|
|
1
|
+
#include "chunk.h"
|
2
|
+
#include "cmark.h"
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
bufsize_t _ext_scan_at(bufsize_t (*scanner)(const unsigned char *),
|
9
|
+
unsigned char *ptr, int len, bufsize_t offset);
|
10
|
+
bufsize_t _scan_table_start(const unsigned char *p);
|
11
|
+
bufsize_t _scan_table_cell(const unsigned char *p);
|
12
|
+
bufsize_t _scan_table_cell_end(const unsigned char *p);
|
13
|
+
bufsize_t _scan_table_row_end(const unsigned char *p);
|
14
|
+
|
15
|
+
#define scan_table_start(c, l, n) _ext_scan_at(&_scan_table_start, c, l, n)
|
16
|
+
#define scan_table_cell(c, l, n) _ext_scan_at(&_scan_table_cell, c, l, n)
|
17
|
+
#define scan_table_cell_end(c, l, n) _ext_scan_at(&_scan_table_cell_end, c, l, n)
|
18
|
+
#define scan_table_row_end(c, l, n) _ext_scan_at(&_scan_table_row_end, c, l, n)
|
19
|
+
|
20
|
+
#ifdef __cplusplus
|
21
|
+
}
|
22
|
+
#endif
|
data/ext/commonmarker/extconf.rb
CHANGED
@@ -1,52 +1,5 @@
|
|
1
1
|
require 'mkmf'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'rbconfig'
|
4
|
-
host_os = RbConfig::CONFIG['host_os']
|
5
|
-
sitearch = RbConfig::CONFIG['sitearch']
|
6
2
|
|
7
|
-
|
8
|
-
INCLUDEDIR = RbConfig::CONFIG['includedir']
|
9
|
-
|
10
|
-
unless find_executable('cmake')
|
11
|
-
abort "\n\n\n[ERROR]: cmake is required and not installed. Get it here: http://www.cmake.org/\n\n\n"
|
12
|
-
end
|
13
|
-
|
14
|
-
ROOT_TMP = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'tmp'))
|
15
|
-
CMARK_DIR = File.expand_path(File.join(File.dirname(__FILE__), 'cmark'))
|
16
|
-
CMARK_BUILD_DIR = File.join(CMARK_DIR, 'build')
|
17
|
-
|
18
|
-
# TODO: we need to clear out the build dir that's erroneously getting packaged
|
19
|
-
# this causes problems, as Linux installation is expecting OS X output
|
20
|
-
if File.directory?(CMARK_BUILD_DIR) && !File.exist?(ROOT_TMP)
|
21
|
-
FileUtils.rm_rf(CMARK_BUILD_DIR)
|
22
|
-
end
|
23
|
-
FileUtils.mkdir_p(CMARK_BUILD_DIR)
|
24
|
-
|
25
|
-
Dir.chdir(CMARK_BUILD_DIR) do
|
26
|
-
if host_os == 'mingw32'
|
27
|
-
system 'cmake .. -G "MSYS Makefiles"'
|
28
|
-
else
|
29
|
-
system 'cmake .. -DCMAKE_C_FLAGS=-fPIC'
|
30
|
-
end
|
31
|
-
system "make libcmark-gfm_static" or abort "make libcmark-gfm_static failed"
|
32
|
-
system "make libcmark-gfmextensions_static" or abort "make libcmark-gfmextensions_static failed"
|
33
|
-
# rake-compiler seems to complain about this line, not sure why it's messing with it
|
34
|
-
FileUtils.rm_rf(File.join(CMARK_BUILD_DIR, 'Testing', 'Temporary'))
|
35
|
-
end
|
36
|
-
|
37
|
-
HEADER_DIRS = [INCLUDEDIR]
|
38
|
-
LIB_DIRS = [LIBDIR, "#{CMARK_BUILD_DIR}/src", "#{CMARK_BUILD_DIR}/extensions"]
|
39
|
-
|
40
|
-
dir_config('cmark', HEADER_DIRS, LIB_DIRS)
|
41
|
-
|
42
|
-
# don't even bother to do this check if using OS X's messed up system Ruby: http://git.io/vsxkn
|
43
|
-
unless sitearch =~ /^universal-darwin/
|
44
|
-
abort 'libcmark-gfm is missing.' unless find_library('cmark-gfm', 'cmark_parse_document')
|
45
|
-
abort 'libcmark-gfmextensions is missing.' unless find_library('cmark-gfmextensions', 'core_extensions_ensure_registered')
|
46
|
-
end
|
47
|
-
|
48
|
-
$LDFLAGS << " -L#{CMARK_BUILD_DIR}/src -L#{CMARK_BUILD_DIR}/extensions -lcmark-gfm -lcmark-gfmextensions"
|
49
|
-
$CFLAGS << " -O2 -I#{CMARK_DIR}/src -I#{CMARK_DIR}/extensions -I#{CMARK_BUILD_DIR}/src -I#{CMARK_BUILD_DIR}/extensions"
|
50
|
-
$CFLAGS << " -DCMARK_STATIC_DEFINE -DCMARKEXTENSIONS_STATIC_DEFINE"
|
3
|
+
$CFLAGS << " -std=c99"
|
51
4
|
|
52
5
|
create_makefile('commonmarker/commonmarker')
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#include "cmark.h"
|
2
|
+
#include "parser.h"
|
3
|
+
#include "footnotes.h"
|
4
|
+
#include "inlines.h"
|
5
|
+
#include "chunk.h"
|
6
|
+
|
7
|
+
static void footnote_free(cmark_map *map, cmark_map_entry *_ref) {
|
8
|
+
cmark_footnote *ref = (cmark_footnote *)_ref;
|
9
|
+
cmark_mem *mem = map->mem;
|
10
|
+
if (ref != NULL) {
|
11
|
+
mem->free(ref->entry.label);
|
12
|
+
if (ref->node)
|
13
|
+
cmark_node_free(ref->node);
|
14
|
+
mem->free(ref);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
void cmark_footnote_create(cmark_map *map, cmark_node *node) {
|
19
|
+
cmark_footnote *ref;
|
20
|
+
unsigned char *reflabel = normalize_map_label(map->mem, &node->as.literal);
|
21
|
+
|
22
|
+
/* empty footnote name, or composed from only whitespace */
|
23
|
+
if (reflabel == NULL)
|
24
|
+
return;
|
25
|
+
|
26
|
+
assert(map->sorted == NULL);
|
27
|
+
|
28
|
+
ref = (cmark_footnote *)map->mem->calloc(1, sizeof(*ref));
|
29
|
+
ref->entry.label = reflabel;
|
30
|
+
ref->node = node;
|
31
|
+
ref->entry.age = map->size;
|
32
|
+
ref->entry.next = map->refs;
|
33
|
+
|
34
|
+
map->refs = (cmark_map_entry *)ref;
|
35
|
+
map->size++;
|
36
|
+
}
|
37
|
+
|
38
|
+
cmark_map *cmark_footnote_map_new(cmark_mem *mem) {
|
39
|
+
return cmark_map_new(mem, footnote_free);
|
40
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#ifndef CMARK_FOOTNOTES_H
|
2
|
+
#define CMARK_FOOTNOTES_H
|
3
|
+
|
4
|
+
#include "map.h"
|
5
|
+
|
6
|
+
#ifdef __cplusplus
|
7
|
+
extern "C" {
|
8
|
+
#endif
|
9
|
+
|
10
|
+
struct cmark_footnote {
|
11
|
+
cmark_map_entry entry;
|
12
|
+
cmark_node *node;
|
13
|
+
unsigned int ix;
|
14
|
+
};
|
15
|
+
|
16
|
+
typedef struct cmark_footnote cmark_footnote;
|
17
|
+
|
18
|
+
void cmark_footnote_create(cmark_map *map, cmark_node *node);
|
19
|
+
cmark_map *cmark_footnote_map_new(cmark_mem *mem);
|
20
|
+
|
21
|
+
#ifdef __cplusplus
|
22
|
+
}
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#endif
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#ifndef CMARK_HOUDINI_H
|
2
|
+
#define CMARK_HOUDINI_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#include <stdint.h>
|
9
|
+
#include "config.h"
|
10
|
+
#include "buffer.h"
|
11
|
+
|
12
|
+
#ifdef HAVE___BUILTIN_EXPECT
|
13
|
+
#define likely(x) __builtin_expect((x), 1)
|
14
|
+
#define unlikely(x) __builtin_expect((x), 0)
|
15
|
+
#else
|
16
|
+
#define likely(x) (x)
|
17
|
+
#define unlikely(x) (x)
|
18
|
+
#endif
|
19
|
+
|
20
|
+
#ifdef HOUDINI_USE_LOCALE
|
21
|
+
#define _isxdigit(c) isxdigit(c)
|
22
|
+
#define _isdigit(c) isdigit(c)
|
23
|
+
#else
|
24
|
+
/*
|
25
|
+
* Helper _isdigit methods -- do not trust the current locale
|
26
|
+
* */
|
27
|
+
#define _isxdigit(c) (strchr("0123456789ABCDEFabcdef", (c)) != NULL)
|
28
|
+
#define _isdigit(c) ((c) >= '0' && (c) <= '9')
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#define HOUDINI_ESCAPED_SIZE(x) (((x)*12) / 10)
|
32
|
+
#define HOUDINI_UNESCAPED_SIZE(x) (x)
|
33
|
+
|
34
|
+
CMARK_EXPORT
|
35
|
+
bufsize_t houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src,
|
36
|
+
bufsize_t size);
|
37
|
+
CMARK_EXPORT
|
38
|
+
int houdini_escape_html(cmark_strbuf *ob, const uint8_t *src,
|
39
|
+
bufsize_t size);
|
40
|
+
CMARK_EXPORT
|
41
|
+
int houdini_escape_html0(cmark_strbuf *ob, const uint8_t *src,
|
42
|
+
bufsize_t size, int secure);
|
43
|
+
CMARK_EXPORT
|
44
|
+
int houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src,
|
45
|
+
bufsize_t size);
|
46
|
+
CMARK_EXPORT
|
47
|
+
void houdini_unescape_html_f(cmark_strbuf *ob, const uint8_t *src,
|
48
|
+
bufsize_t size);
|
49
|
+
CMARK_EXPORT
|
50
|
+
int houdini_escape_href(cmark_strbuf *ob, const uint8_t *src,
|
51
|
+
bufsize_t size);
|
52
|
+
|
53
|
+
#ifdef __cplusplus
|
54
|
+
}
|
55
|
+
#endif
|
56
|
+
|
57
|
+
#endif
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#include <assert.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <string.h>
|
4
|
+
|
5
|
+
#include "houdini.h"
|
6
|
+
|
7
|
+
/*
|
8
|
+
* The following characters will not be escaped:
|
9
|
+
*
|
10
|
+
* -_.+!*'(),%#@?=;:/,+&$ alphanum
|
11
|
+
*
|
12
|
+
* Note that this character set is the addition of:
|
13
|
+
*
|
14
|
+
* - The characters which are safe to be in an URL
|
15
|
+
* - The characters which are *not* safe to be in
|
16
|
+
* an URL because they are RESERVED characters.
|
17
|
+
*
|
18
|
+
* We asume (lazily) that any RESERVED char that
|
19
|
+
* appears inside an URL is actually meant to
|
20
|
+
* have its native function (i.e. as an URL
|
21
|
+
* component/separator) and hence needs no escaping.
|
22
|
+
*
|
23
|
+
* There are two exceptions: the chacters & (amp)
|
24
|
+
* and ' (single quote) do not appear in the table.
|
25
|
+
* They are meant to appear in the URL as components,
|
26
|
+
* yet they require special HTML-entity escaping
|
27
|
+
* to generate valid HTML markup.
|
28
|
+
*
|
29
|
+
* All other characters will be escaped to %XX.
|
30
|
+
*
|
31
|
+
*/
|
32
|
+
static const char HREF_SAFE[] = {
|
33
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
34
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
|
35
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
36
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
|
37
|
+
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
38
|
+
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
39
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
40
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
41
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
42
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
43
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
44
|
+
};
|
45
|
+
|
46
|
+
int houdini_escape_href(cmark_strbuf *ob, const uint8_t *src, bufsize_t size) {
|
47
|
+
static const uint8_t hex_chars[] = "0123456789ABCDEF";
|
48
|
+
bufsize_t i = 0, org;
|
49
|
+
uint8_t hex_str[3];
|
50
|
+
|
51
|
+
hex_str[0] = '%';
|
52
|
+
|
53
|
+
while (i < size) {
|
54
|
+
org = i;
|
55
|
+
while (i < size && HREF_SAFE[src[i]] != 0)
|
56
|
+
i++;
|
57
|
+
|
58
|
+
if (likely(i > org))
|
59
|
+
cmark_strbuf_put(ob, src + org, i - org);
|
60
|
+
|
61
|
+
/* escaping */
|
62
|
+
if (i >= size)
|
63
|
+
break;
|
64
|
+
|
65
|
+
switch (src[i]) {
|
66
|
+
/* amp appears all the time in URLs, but needs
|
67
|
+
* HTML-entity escaping to be inside an href */
|
68
|
+
case '&':
|
69
|
+
cmark_strbuf_puts(ob, "&");
|
70
|
+
break;
|
71
|
+
|
72
|
+
/* the single quote is a valid URL character
|
73
|
+
* according to the standard; it needs HTML
|
74
|
+
* entity escaping too */
|
75
|
+
case '\'':
|
76
|
+
cmark_strbuf_puts(ob, "'");
|
77
|
+
break;
|
78
|
+
|
79
|
+
/* the space can be escaped to %20 or a plus
|
80
|
+
* sign. we're going with the generic escape
|
81
|
+
* for now. the plus thing is more commonly seen
|
82
|
+
* when building GET strings */
|
83
|
+
#if 0
|
84
|
+
case ' ':
|
85
|
+
cmark_strbuf_putc(ob, '+');
|
86
|
+
break;
|
87
|
+
#endif
|
88
|
+
|
89
|
+
/* every other character goes with a %XX escaping */
|
90
|
+
default:
|
91
|
+
hex_str[1] = hex_chars[(src[i] >> 4) & 0xF];
|
92
|
+
hex_str[2] = hex_chars[src[i] & 0xF];
|
93
|
+
cmark_strbuf_put(ob, hex_str, 3);
|
94
|
+
}
|
95
|
+
|
96
|
+
i++;
|
97
|
+
}
|
98
|
+
|
99
|
+
return 1;
|
100
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#include <assert.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <string.h>
|
4
|
+
|
5
|
+
#include "houdini.h"
|
6
|
+
|
7
|
+
/**
|
8
|
+
* According to the OWASP rules:
|
9
|
+
*
|
10
|
+
* & --> &
|
11
|
+
* < --> <
|
12
|
+
* > --> >
|
13
|
+
* " --> "
|
14
|
+
* ' --> ' ' is not recommended
|
15
|
+
* / --> / forward slash is included as it helps end an HTML entity
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
static const char HTML_ESCAPE_TABLE[] = {
|
19
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
20
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 4,
|
21
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
22
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
23
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
24
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
25
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
26
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
27
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
28
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
29
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
30
|
+
};
|
31
|
+
|
32
|
+
static const char *HTML_ESCAPES[] = {"", """, "&", "'",
|
33
|
+
"/", "<", ">"};
|
34
|
+
|
35
|
+
int houdini_escape_html0(cmark_strbuf *ob, const uint8_t *src, bufsize_t size,
|
36
|
+
int secure) {
|
37
|
+
bufsize_t i = 0, org, esc = 0;
|
38
|
+
|
39
|
+
while (i < size) {
|
40
|
+
org = i;
|
41
|
+
while (i < size && (esc = HTML_ESCAPE_TABLE[src[i]]) == 0)
|
42
|
+
i++;
|
43
|
+
|
44
|
+
if (i > org)
|
45
|
+
cmark_strbuf_put(ob, src + org, i - org);
|
46
|
+
|
47
|
+
/* escaping */
|
48
|
+
if (unlikely(i >= size))
|
49
|
+
break;
|
50
|
+
|
51
|
+
/* The forward slash and single quote are only escaped in secure mode */
|
52
|
+
if ((src[i] == '/' || src[i] == '\'') && !secure) {
|
53
|
+
cmark_strbuf_putc(ob, src[i]);
|
54
|
+
} else {
|
55
|
+
cmark_strbuf_puts(ob, HTML_ESCAPES[esc]);
|
56
|
+
}
|
57
|
+
|
58
|
+
i++;
|
59
|
+
}
|
60
|
+
|
61
|
+
return 1;
|
62
|
+
}
|
63
|
+
|
64
|
+
int houdini_escape_html(cmark_strbuf *ob, const uint8_t *src, bufsize_t size) {
|
65
|
+
return houdini_escape_html0(ob, src, size, 1);
|
66
|
+
}
|
@@ -0,0 +1,149 @@
|
|
1
|
+
#include <assert.h>
|
2
|
+
#include <stdio.h>
|
3
|
+
#include <string.h>
|
4
|
+
|
5
|
+
#include "buffer.h"
|
6
|
+
#include "houdini.h"
|
7
|
+
#include "utf8.h"
|
8
|
+
#include "entities.inc"
|
9
|
+
|
10
|
+
/* Binary tree lookup code for entities added by JGM */
|
11
|
+
|
12
|
+
static const unsigned char *S_lookup(int i, int low, int hi,
|
13
|
+
const unsigned char *s, int len) {
|
14
|
+
int j;
|
15
|
+
int cmp =
|
16
|
+
strncmp((const char *)s, (const char *)cmark_entities[i].entity, len);
|
17
|
+
if (cmp == 0 && cmark_entities[i].entity[len] == 0) {
|
18
|
+
return (const unsigned char *)cmark_entities[i].bytes;
|
19
|
+
} else if (cmp <= 0 && i > low) {
|
20
|
+
j = i - ((i - low) / 2);
|
21
|
+
if (j == i)
|
22
|
+
j -= 1;
|
23
|
+
return S_lookup(j, low, i - 1, s, len);
|
24
|
+
} else if (cmp > 0 && i < hi) {
|
25
|
+
j = i + ((hi - i) / 2);
|
26
|
+
if (j == i)
|
27
|
+
j += 1;
|
28
|
+
return S_lookup(j, i + 1, hi, s, len);
|
29
|
+
} else {
|
30
|
+
return NULL;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
static const unsigned char *S_lookup_entity(const unsigned char *s, int len) {
|
35
|
+
return S_lookup(CMARK_NUM_ENTITIES / 2, 0, CMARK_NUM_ENTITIES - 1, s, len);
|
36
|
+
}
|
37
|
+
|
38
|
+
bufsize_t houdini_unescape_ent(cmark_strbuf *ob, const uint8_t *src,
|
39
|
+
bufsize_t size) {
|
40
|
+
bufsize_t i = 0;
|
41
|
+
|
42
|
+
if (size >= 3 && src[0] == '#') {
|
43
|
+
int codepoint = 0;
|
44
|
+
int num_digits = 0;
|
45
|
+
|
46
|
+
if (_isdigit(src[1])) {
|
47
|
+
for (i = 1; i < size && _isdigit(src[i]); ++i) {
|
48
|
+
codepoint = (codepoint * 10) + (src[i] - '0');
|
49
|
+
|
50
|
+
if (codepoint >= 0x110000) {
|
51
|
+
// Keep counting digits but
|
52
|
+
// avoid integer overflow.
|
53
|
+
codepoint = 0x110000;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
num_digits = i - 1;
|
58
|
+
}
|
59
|
+
|
60
|
+
else if (src[1] == 'x' || src[1] == 'X') {
|
61
|
+
for (i = 2; i < size && _isxdigit(src[i]); ++i) {
|
62
|
+
codepoint = (codepoint * 16) + ((src[i] | 32) % 39 - 9);
|
63
|
+
|
64
|
+
if (codepoint >= 0x110000) {
|
65
|
+
// Keep counting digits but
|
66
|
+
// avoid integer overflow.
|
67
|
+
codepoint = 0x110000;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
num_digits = i - 2;
|
72
|
+
}
|
73
|
+
|
74
|
+
if (num_digits >= 1 && num_digits <= 8 && i < size && src[i] == ';') {
|
75
|
+
if (codepoint == 0 || (codepoint >= 0xD800 && codepoint < 0xE000) ||
|
76
|
+
codepoint >= 0x110000) {
|
77
|
+
codepoint = 0xFFFD;
|
78
|
+
}
|
79
|
+
cmark_utf8proc_encode_char(codepoint, ob);
|
80
|
+
return i + 1;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
else {
|
85
|
+
if (size > CMARK_ENTITY_MAX_LENGTH)
|
86
|
+
size = CMARK_ENTITY_MAX_LENGTH;
|
87
|
+
|
88
|
+
for (i = CMARK_ENTITY_MIN_LENGTH; i < size; ++i) {
|
89
|
+
if (src[i] == ' ')
|
90
|
+
break;
|
91
|
+
|
92
|
+
if (src[i] == ';') {
|
93
|
+
const unsigned char *entity = S_lookup_entity(src, i);
|
94
|
+
|
95
|
+
if (entity != NULL) {
|
96
|
+
cmark_strbuf_puts(ob, (const char *)entity);
|
97
|
+
return i + 1;
|
98
|
+
}
|
99
|
+
|
100
|
+
break;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
return 0;
|
106
|
+
}
|
107
|
+
|
108
|
+
int houdini_unescape_html(cmark_strbuf *ob, const uint8_t *src,
|
109
|
+
bufsize_t size) {
|
110
|
+
bufsize_t i = 0, org, ent;
|
111
|
+
|
112
|
+
while (i < size) {
|
113
|
+
org = i;
|
114
|
+
while (i < size && src[i] != '&')
|
115
|
+
i++;
|
116
|
+
|
117
|
+
if (likely(i > org)) {
|
118
|
+
if (unlikely(org == 0)) {
|
119
|
+
if (i >= size)
|
120
|
+
return 0;
|
121
|
+
|
122
|
+
cmark_strbuf_grow(ob, HOUDINI_UNESCAPED_SIZE(size));
|
123
|
+
}
|
124
|
+
|
125
|
+
cmark_strbuf_put(ob, src + org, i - org);
|
126
|
+
}
|
127
|
+
|
128
|
+
/* escaping */
|
129
|
+
if (i >= size)
|
130
|
+
break;
|
131
|
+
|
132
|
+
i++;
|
133
|
+
|
134
|
+
ent = houdini_unescape_ent(ob, src + i, size - i);
|
135
|
+
i += ent;
|
136
|
+
|
137
|
+
/* not really an entity */
|
138
|
+
if (ent == 0)
|
139
|
+
cmark_strbuf_putc(ob, '&');
|
140
|
+
}
|
141
|
+
|
142
|
+
return 1;
|
143
|
+
}
|
144
|
+
|
145
|
+
void houdini_unescape_html_f(cmark_strbuf *ob, const uint8_t *src,
|
146
|
+
bufsize_t size) {
|
147
|
+
if (!houdini_unescape_html(ob, src, size))
|
148
|
+
cmark_strbuf_put(ob, src, size);
|
149
|
+
}
|