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,29 @@
|
|
1
|
+
# Install script for directory: /Users/kivikakk/Code/gjtorikian/commonmarker/ext/commonmarker/cmark-upstream/test
|
2
|
+
|
3
|
+
# Set the install prefix
|
4
|
+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
5
|
+
set(CMAKE_INSTALL_PREFIX "/usr/local")
|
6
|
+
endif()
|
7
|
+
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
8
|
+
|
9
|
+
# Set the install configuration name.
|
10
|
+
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
11
|
+
if(BUILD_TYPE)
|
12
|
+
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
13
|
+
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
14
|
+
else()
|
15
|
+
set(CMAKE_INSTALL_CONFIG_NAME "Release")
|
16
|
+
endif()
|
17
|
+
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
18
|
+
endif()
|
19
|
+
|
20
|
+
# Set the component getting installed.
|
21
|
+
if(NOT CMAKE_INSTALL_COMPONENT)
|
22
|
+
if(COMPONENT)
|
23
|
+
message(STATUS "Install component: \"${COMPONENT}\"")
|
24
|
+
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
25
|
+
else()
|
26
|
+
set(CMAKE_INSTALL_COMPONENT)
|
27
|
+
endif()
|
28
|
+
endif()
|
29
|
+
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,421 @@
|
|
1
|
+
#include "autolink.h"
|
2
|
+
#include <parser.h>
|
3
|
+
#include <string.h>
|
4
|
+
#include <utf8.h>
|
5
|
+
|
6
|
+
#if defined(_WIN32)
|
7
|
+
#define strncasecmp _strnicmp
|
8
|
+
#else
|
9
|
+
#include <strings.h>
|
10
|
+
#endif
|
11
|
+
|
12
|
+
static int is_valid_hostchar(const uint8_t *link, size_t link_len) {
|
13
|
+
int32_t ch;
|
14
|
+
int r = cmark_utf8proc_iterate(link, (bufsize_t)link_len, &ch);
|
15
|
+
if (r < 0)
|
16
|
+
return 0;
|
17
|
+
return !cmark_utf8proc_is_space(ch) && !cmark_utf8proc_is_punctuation(ch);
|
18
|
+
}
|
19
|
+
|
20
|
+
static int sd_autolink_issafe(const uint8_t *link, size_t link_len) {
|
21
|
+
static const size_t valid_uris_count = 3;
|
22
|
+
static const char *valid_uris[] = {"http://", "https://", "ftp://"};
|
23
|
+
|
24
|
+
size_t i;
|
25
|
+
|
26
|
+
for (i = 0; i < valid_uris_count; ++i) {
|
27
|
+
size_t len = strlen(valid_uris[i]);
|
28
|
+
|
29
|
+
if (link_len > len && strncasecmp((char *)link, valid_uris[i], len) == 0 &&
|
30
|
+
is_valid_hostchar(link + len, link_len - len))
|
31
|
+
return 1;
|
32
|
+
}
|
33
|
+
|
34
|
+
return 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
static size_t autolink_delim(uint8_t *data, size_t link_end) {
|
38
|
+
uint8_t cclose, copen;
|
39
|
+
size_t i;
|
40
|
+
|
41
|
+
for (i = 0; i < link_end; ++i)
|
42
|
+
if (data[i] == '<') {
|
43
|
+
link_end = i;
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
|
47
|
+
while (link_end > 0) {
|
48
|
+
cclose = data[link_end - 1];
|
49
|
+
|
50
|
+
switch (cclose) {
|
51
|
+
case ')':
|
52
|
+
copen = '(';
|
53
|
+
break;
|
54
|
+
default:
|
55
|
+
copen = 0;
|
56
|
+
}
|
57
|
+
|
58
|
+
if (strchr("?!.,:*_~'\"", data[link_end - 1]) != NULL)
|
59
|
+
link_end--;
|
60
|
+
|
61
|
+
else if (data[link_end - 1] == ';') {
|
62
|
+
size_t new_end = link_end - 2;
|
63
|
+
|
64
|
+
while (new_end > 0 && cmark_isalpha(data[new_end]))
|
65
|
+
new_end--;
|
66
|
+
|
67
|
+
if (new_end < link_end - 2 && data[new_end] == '&')
|
68
|
+
link_end = new_end;
|
69
|
+
else
|
70
|
+
link_end--;
|
71
|
+
} else if (copen != 0) {
|
72
|
+
size_t closing = 0;
|
73
|
+
size_t opening = 0;
|
74
|
+
i = 0;
|
75
|
+
|
76
|
+
/* Allow any number of matching brackets (as recognised in copen/cclose)
|
77
|
+
* at the end of the URL. If there is a greater number of closing
|
78
|
+
* brackets than opening ones, we remove one character from the end of
|
79
|
+
* the link.
|
80
|
+
*
|
81
|
+
* Examples (input text => output linked portion):
|
82
|
+
*
|
83
|
+
* http://www.pokemon.com/Pikachu_(Electric)
|
84
|
+
* => http://www.pokemon.com/Pikachu_(Electric)
|
85
|
+
*
|
86
|
+
* http://www.pokemon.com/Pikachu_((Electric)
|
87
|
+
* => http://www.pokemon.com/Pikachu_((Electric)
|
88
|
+
*
|
89
|
+
* http://www.pokemon.com/Pikachu_(Electric))
|
90
|
+
* => http://www.pokemon.com/Pikachu_(Electric)
|
91
|
+
*
|
92
|
+
* http://www.pokemon.com/Pikachu_((Electric))
|
93
|
+
* => http://www.pokemon.com/Pikachu_((Electric))
|
94
|
+
*/
|
95
|
+
|
96
|
+
while (i < link_end) {
|
97
|
+
if (data[i] == copen)
|
98
|
+
opening++;
|
99
|
+
else if (data[i] == cclose)
|
100
|
+
closing++;
|
101
|
+
|
102
|
+
i++;
|
103
|
+
}
|
104
|
+
|
105
|
+
if (closing <= opening)
|
106
|
+
break;
|
107
|
+
|
108
|
+
link_end--;
|
109
|
+
} else
|
110
|
+
break;
|
111
|
+
}
|
112
|
+
|
113
|
+
return link_end;
|
114
|
+
}
|
115
|
+
|
116
|
+
static size_t check_domain(uint8_t *data, size_t size, int allow_short) {
|
117
|
+
size_t i, np = 0, uscore1 = 0, uscore2 = 0;
|
118
|
+
|
119
|
+
for (i = 1; i < size - 1; i++) {
|
120
|
+
if (data[i] == '_')
|
121
|
+
uscore2++;
|
122
|
+
else if (data[i] == '.') {
|
123
|
+
uscore1 = uscore2;
|
124
|
+
uscore2 = 0;
|
125
|
+
np++;
|
126
|
+
} else if (!is_valid_hostchar(data + i, size - i) && data[i] != '-')
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
|
130
|
+
if (uscore1 > 0 || uscore2 > 0)
|
131
|
+
return 0;
|
132
|
+
|
133
|
+
if (allow_short) {
|
134
|
+
/* We don't need a valid domain in the strict sense (with
|
135
|
+
* least one dot; so just make sure it's composed of valid
|
136
|
+
* domain characters and return the length of the the valid
|
137
|
+
* sequence. */
|
138
|
+
return i;
|
139
|
+
} else {
|
140
|
+
/* a valid domain needs to have at least a dot.
|
141
|
+
* that's as far as we get */
|
142
|
+
return np ? i : 0;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
static cmark_node *www_match(cmark_parser *parser, cmark_node *parent,
|
147
|
+
cmark_inline_parser *inline_parser) {
|
148
|
+
cmark_chunk *chunk = cmark_inline_parser_get_chunk(inline_parser);
|
149
|
+
size_t max_rewind = cmark_inline_parser_get_offset(inline_parser);
|
150
|
+
uint8_t *data = chunk->data + max_rewind;
|
151
|
+
size_t size = chunk->len - max_rewind;
|
152
|
+
int start = cmark_inline_parser_get_column(inline_parser);
|
153
|
+
|
154
|
+
size_t link_end;
|
155
|
+
|
156
|
+
if (max_rewind > 0 && strchr("*_~(", data[-1]) == NULL &&
|
157
|
+
!cmark_isspace(data[-1]))
|
158
|
+
return 0;
|
159
|
+
|
160
|
+
if (size < 4 || memcmp(data, "www.", strlen("www.")) != 0)
|
161
|
+
return 0;
|
162
|
+
|
163
|
+
link_end = check_domain(data, size, 0);
|
164
|
+
|
165
|
+
if (link_end == 0)
|
166
|
+
return NULL;
|
167
|
+
|
168
|
+
while (link_end < size && !cmark_isspace(data[link_end]))
|
169
|
+
link_end++;
|
170
|
+
|
171
|
+
link_end = autolink_delim(data, link_end);
|
172
|
+
|
173
|
+
if (link_end == 0)
|
174
|
+
return NULL;
|
175
|
+
|
176
|
+
cmark_inline_parser_set_offset(inline_parser, (int)(max_rewind + link_end));
|
177
|
+
|
178
|
+
cmark_node *node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
|
179
|
+
|
180
|
+
cmark_strbuf buf;
|
181
|
+
cmark_strbuf_init(parser->mem, &buf, 10);
|
182
|
+
cmark_strbuf_puts(&buf, "http://");
|
183
|
+
cmark_strbuf_put(&buf, data, (bufsize_t)link_end);
|
184
|
+
node->as.link.url = cmark_chunk_buf_detach(&buf);
|
185
|
+
|
186
|
+
cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
|
187
|
+
text->as.literal =
|
188
|
+
cmark_chunk_dup(chunk, (bufsize_t)max_rewind, (bufsize_t)link_end);
|
189
|
+
cmark_node_append_child(node, text);
|
190
|
+
|
191
|
+
node->start_line = text->start_line =
|
192
|
+
node->end_line = text->end_line =
|
193
|
+
cmark_inline_parser_get_line(inline_parser);
|
194
|
+
|
195
|
+
node->start_column = text->start_column = start - 1;
|
196
|
+
node->end_column = text->end_column = cmark_inline_parser_get_column(inline_parser) - 1;
|
197
|
+
|
198
|
+
return node;
|
199
|
+
}
|
200
|
+
|
201
|
+
static cmark_node *url_match(cmark_parser *parser, cmark_node *parent,
|
202
|
+
cmark_inline_parser *inline_parser) {
|
203
|
+
size_t link_end, domain_len;
|
204
|
+
int rewind = 0;
|
205
|
+
|
206
|
+
cmark_chunk *chunk = cmark_inline_parser_get_chunk(inline_parser);
|
207
|
+
int max_rewind = cmark_inline_parser_get_offset(inline_parser);
|
208
|
+
uint8_t *data = chunk->data + max_rewind;
|
209
|
+
size_t size = chunk->len - max_rewind;
|
210
|
+
|
211
|
+
if (size < 4 || data[1] != '/' || data[2] != '/')
|
212
|
+
return 0;
|
213
|
+
|
214
|
+
while (rewind < max_rewind && cmark_isalpha(data[-rewind - 1]))
|
215
|
+
rewind++;
|
216
|
+
|
217
|
+
if (!sd_autolink_issafe(data - rewind, size + rewind))
|
218
|
+
return 0;
|
219
|
+
|
220
|
+
link_end = strlen("://");
|
221
|
+
|
222
|
+
domain_len = check_domain(data + link_end, size - link_end, 1);
|
223
|
+
|
224
|
+
if (domain_len == 0)
|
225
|
+
return 0;
|
226
|
+
|
227
|
+
link_end += domain_len;
|
228
|
+
while (link_end < size && !cmark_isspace(data[link_end]))
|
229
|
+
link_end++;
|
230
|
+
|
231
|
+
link_end = autolink_delim(data, link_end);
|
232
|
+
|
233
|
+
if (link_end == 0)
|
234
|
+
return NULL;
|
235
|
+
|
236
|
+
cmark_inline_parser_set_offset(inline_parser, (int)(max_rewind + link_end));
|
237
|
+
cmark_node_unput(parent, rewind);
|
238
|
+
|
239
|
+
cmark_node *node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
|
240
|
+
|
241
|
+
cmark_chunk url = cmark_chunk_dup(chunk, max_rewind - rewind,
|
242
|
+
(bufsize_t)(link_end + rewind));
|
243
|
+
node->as.link.url = url;
|
244
|
+
|
245
|
+
cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
|
246
|
+
text->as.literal = url;
|
247
|
+
cmark_node_append_child(node, text);
|
248
|
+
|
249
|
+
return node;
|
250
|
+
}
|
251
|
+
|
252
|
+
static cmark_node *match(cmark_syntax_extension *ext, cmark_parser *parser,
|
253
|
+
cmark_node *parent, unsigned char c,
|
254
|
+
cmark_inline_parser *inline_parser) {
|
255
|
+
if (cmark_inline_parser_in_bracket(inline_parser, false) ||
|
256
|
+
cmark_inline_parser_in_bracket(inline_parser, true))
|
257
|
+
return NULL;
|
258
|
+
|
259
|
+
if (c == ':')
|
260
|
+
return url_match(parser, parent, inline_parser);
|
261
|
+
|
262
|
+
if (c == 'w')
|
263
|
+
return www_match(parser, parent, inline_parser);
|
264
|
+
|
265
|
+
return NULL;
|
266
|
+
|
267
|
+
// note that we could end up re-consuming something already a
|
268
|
+
// part of an inline, because we don't track when the last
|
269
|
+
// inline was finished in inlines.c.
|
270
|
+
}
|
271
|
+
|
272
|
+
static void postprocess_text(cmark_parser *parser, cmark_node *text, int offset) {
|
273
|
+
size_t link_end;
|
274
|
+
uint8_t *data = text->as.literal.data,
|
275
|
+
*at;
|
276
|
+
size_t size = text->as.literal.len;
|
277
|
+
int rewind, max_rewind,
|
278
|
+
nb = 0, np = 0, ns = 0;
|
279
|
+
|
280
|
+
if (offset < 0 || (size_t)offset >= size)
|
281
|
+
return;
|
282
|
+
|
283
|
+
data += offset;
|
284
|
+
size -= offset;
|
285
|
+
|
286
|
+
at = (uint8_t *)memchr(data, '@', size);
|
287
|
+
if (!at)
|
288
|
+
return;
|
289
|
+
|
290
|
+
max_rewind = (int)(at - data);
|
291
|
+
data += max_rewind;
|
292
|
+
size -= max_rewind;
|
293
|
+
|
294
|
+
for (rewind = 0; rewind < max_rewind; ++rewind) {
|
295
|
+
uint8_t c = data[-rewind - 1];
|
296
|
+
|
297
|
+
if (cmark_isalnum(c))
|
298
|
+
continue;
|
299
|
+
|
300
|
+
if (strchr(".+-_", c) != NULL)
|
301
|
+
continue;
|
302
|
+
|
303
|
+
if (c == '/')
|
304
|
+
ns++;
|
305
|
+
|
306
|
+
break;
|
307
|
+
}
|
308
|
+
|
309
|
+
if (rewind == 0 || ns > 0) {
|
310
|
+
postprocess_text(parser, text, max_rewind + 1 + offset);
|
311
|
+
return;
|
312
|
+
}
|
313
|
+
|
314
|
+
for (link_end = 0; link_end < size; ++link_end) {
|
315
|
+
uint8_t c = data[link_end];
|
316
|
+
|
317
|
+
if (cmark_isalnum(c))
|
318
|
+
continue;
|
319
|
+
|
320
|
+
if (c == '@')
|
321
|
+
nb++;
|
322
|
+
else if (c == '.' && link_end < size - 1 && cmark_isalnum(data[link_end + 1]))
|
323
|
+
np++;
|
324
|
+
else if (c != '-' && c != '_')
|
325
|
+
break;
|
326
|
+
}
|
327
|
+
|
328
|
+
if (link_end < 2 || nb != 1 || np == 0 ||
|
329
|
+
(!cmark_isalpha(data[link_end - 1]) && data[link_end - 1] != '.')) {
|
330
|
+
postprocess_text(parser, text, max_rewind + 1 + offset);
|
331
|
+
return;
|
332
|
+
}
|
333
|
+
|
334
|
+
link_end = autolink_delim(data, link_end);
|
335
|
+
|
336
|
+
if (link_end == 0) {
|
337
|
+
postprocess_text(parser, text, max_rewind + 1 + offset);
|
338
|
+
return;
|
339
|
+
}
|
340
|
+
|
341
|
+
cmark_chunk_to_cstr(parser->mem, &text->as.literal);
|
342
|
+
|
343
|
+
cmark_node *link_node = cmark_node_new_with_mem(CMARK_NODE_LINK, parser->mem);
|
344
|
+
cmark_strbuf buf;
|
345
|
+
cmark_strbuf_init(parser->mem, &buf, 10);
|
346
|
+
cmark_strbuf_puts(&buf, "mailto:");
|
347
|
+
cmark_strbuf_put(&buf, data - rewind, (bufsize_t)(link_end + rewind));
|
348
|
+
link_node->as.link.url = cmark_chunk_buf_detach(&buf);
|
349
|
+
|
350
|
+
cmark_node *link_text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
|
351
|
+
cmark_chunk email = cmark_chunk_dup(
|
352
|
+
&text->as.literal,
|
353
|
+
offset + max_rewind - rewind,
|
354
|
+
(bufsize_t)(link_end + rewind));
|
355
|
+
cmark_chunk_to_cstr(parser->mem, &email);
|
356
|
+
link_text->as.literal = email;
|
357
|
+
cmark_node_append_child(link_node, link_text);
|
358
|
+
|
359
|
+
cmark_node_insert_after(text, link_node);
|
360
|
+
|
361
|
+
cmark_node *post = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
|
362
|
+
post->as.literal = cmark_chunk_dup(&text->as.literal,
|
363
|
+
(bufsize_t)(offset + max_rewind + link_end),
|
364
|
+
(bufsize_t)(size - link_end));
|
365
|
+
cmark_chunk_to_cstr(parser->mem, &post->as.literal);
|
366
|
+
|
367
|
+
cmark_node_insert_after(link_node, post);
|
368
|
+
|
369
|
+
text->as.literal.len = offset + max_rewind - rewind;
|
370
|
+
text->as.literal.data[text->as.literal.len] = 0;
|
371
|
+
|
372
|
+
postprocess_text(parser, post, 0);
|
373
|
+
}
|
374
|
+
|
375
|
+
static cmark_node *postprocess(cmark_syntax_extension *ext, cmark_parser *parser, cmark_node *root) {
|
376
|
+
cmark_iter *iter;
|
377
|
+
cmark_event_type ev;
|
378
|
+
cmark_node *node;
|
379
|
+
bool in_link = false;
|
380
|
+
|
381
|
+
cmark_consolidate_text_nodes(root);
|
382
|
+
iter = cmark_iter_new(root);
|
383
|
+
|
384
|
+
while ((ev = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
|
385
|
+
node = cmark_iter_get_node(iter);
|
386
|
+
if (in_link) {
|
387
|
+
if (ev == CMARK_EVENT_EXIT && node->type == CMARK_NODE_LINK) {
|
388
|
+
in_link = false;
|
389
|
+
}
|
390
|
+
continue;
|
391
|
+
}
|
392
|
+
|
393
|
+
if (ev == CMARK_EVENT_ENTER && node->type == CMARK_NODE_LINK) {
|
394
|
+
in_link = true;
|
395
|
+
continue;
|
396
|
+
}
|
397
|
+
|
398
|
+
if (ev == CMARK_EVENT_ENTER && node->type == CMARK_NODE_TEXT) {
|
399
|
+
postprocess_text(parser, node, 0);
|
400
|
+
}
|
401
|
+
}
|
402
|
+
|
403
|
+
cmark_iter_free(iter);
|
404
|
+
|
405
|
+
return root;
|
406
|
+
}
|
407
|
+
|
408
|
+
cmark_syntax_extension *create_autolink_extension(void) {
|
409
|
+
cmark_syntax_extension *ext = cmark_syntax_extension_new("autolink");
|
410
|
+
cmark_llist *special_chars = NULL;
|
411
|
+
|
412
|
+
cmark_syntax_extension_set_match_inline_func(ext, match);
|
413
|
+
cmark_syntax_extension_set_postprocess_func(ext, postprocess);
|
414
|
+
|
415
|
+
cmark_mem *mem = cmark_get_default_mem_allocator();
|
416
|
+
special_chars = cmark_llist_append(mem, special_chars, (void *)':');
|
417
|
+
special_chars = cmark_llist_append(mem, special_chars, (void *)'w');
|
418
|
+
cmark_syntax_extension_set_special_inline_chars(ext, special_chars);
|
419
|
+
|
420
|
+
return ext;
|
421
|
+
}
|