commonmarker 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of commonmarker might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +119 -0
- data/Rakefile +39 -0
- data/bin/commonmarker +41 -0
- data/commonmarker.gemspec +30 -0
- data/ext/commonmarker/cmark/CMakeLists.txt +25 -0
- data/ext/commonmarker/cmark/COPYING +192 -0
- data/ext/commonmarker/cmark/FindAsan.cmake +74 -0
- data/ext/commonmarker/cmark/Makefile +170 -0
- data/ext/commonmarker/cmark/Makefile.nmake +36 -0
- data/ext/commonmarker/cmark/README.md +169 -0
- data/ext/commonmarker/cmark/api_test/CMakeLists.txt +25 -0
- data/ext/commonmarker/cmark/api_test/cplusplus.cpp +15 -0
- data/ext/commonmarker/cmark/api_test/cplusplus.h +17 -0
- data/ext/commonmarker/cmark/api_test/harness.c +102 -0
- data/ext/commonmarker/cmark/api_test/harness.h +42 -0
- data/ext/commonmarker/cmark/api_test/main.c +700 -0
- data/ext/commonmarker/cmark/appveyor.yml +15 -0
- data/ext/commonmarker/cmark/bench/statistics.py +595 -0
- data/ext/commonmarker/cmark/bench/stats.py +19 -0
- data/ext/commonmarker/cmark/benchmarks.md +33 -0
- data/ext/commonmarker/cmark/build/CMakeCache.txt +362 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCCompiler.cmake +63 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeCXXCompiler.cmake +64 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_C.bin +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CMakeSystem.cmake +15 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c +499 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdC/a.out +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +489 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/3.2.2/CompilerIdCXX/a.out +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/CMakeError.log +30 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/CMakeOutput.log +598 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/Makefile.cmake +77 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/Makefile2 +268 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/TargetDirectories.txt +4 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/cmake.check_cache +1 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.bin +0 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.c +34 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/feature_tests.cxx +405 -0
- data/ext/commonmarker/cmark/build/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/CTestTestfile.cmake +10 -0
- data/ext/commonmarker/cmark/build/Makefile +237 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/C.includecache +92 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +36 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +29 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/build.make +155 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +12 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/cplusplus.cpp.o +0 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.internal +25 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/depend.make +25 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/flags.make +13 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/harness.c.o +0 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/link.txt +1 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/main.c.o +0 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/api_test.dir/progress.make +4 -0
- data/ext/commonmarker/cmark/build/api_test/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/api_test/Makefile +277 -0
- data/ext/commonmarker/cmark/build/api_test/api_test +0 -0
- data/ext/commonmarker/cmark/build/api_test/cmake_install.cmake +29 -0
- data/ext/commonmarker/cmark/build/cmake_install.cmake +48 -0
- data/ext/commonmarker/cmark/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/man/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/man/Makefile +181 -0
- data/ext/commonmarker/cmark/build/man/cmake_install.cmake +37 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/C.includecache +422 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/DependInfo.cmake +39 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/buffer.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/build.make +544 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmake_clean.cmake +27 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/cmark_ctype.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.internal +177 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/depend.make +177 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/flags.make +8 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_href_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/houdini_html_u.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/link.txt +1 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/main.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/progress.make +19 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/references.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/utf8.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/cmark.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/C.includecache +394 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/DependInfo.cmake +44 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/buffer.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/build.make +522 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmake_clean.cmake +27 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/cmark_ctype.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.internal +169 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/depend.make +169 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/flags.make +8 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_href_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/houdini_html_u.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/link.txt +1 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/progress.make +18 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/references.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/utf8.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/C.includecache +394 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/DependInfo.cmake +38 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/blocks.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/buffer.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/build.make +519 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean.cmake +26 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmake_clean_target.cmake +3 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/cmark_ctype.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/commonmark.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.internal +169 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/depend.make +169 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/flags.make +8 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_href_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_e.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/houdini_html_u.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/html.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/inlines.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/iterator.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/link.txt +2 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/man.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/node.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/progress.make +18 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/references.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/scanners.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/utf8.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/libcmark_static.dir/xml.c.o +0 -0
- data/ext/commonmarker/cmark/build/src/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/src/Makefile +814 -0
- data/ext/commonmarker/cmark/build/src/cmake_install.cmake +69 -0
- data/ext/commonmarker/cmark/build/src/cmark +0 -0
- data/ext/commonmarker/cmark/build/src/cmark_export.h +41 -0
- data/ext/commonmarker/cmark/build/src/cmark_version.h +7 -0
- data/ext/commonmarker/cmark/build/src/config.h +23 -0
- data/ext/commonmarker/cmark/build/src/libcmark.0.19.0.dylib +0 -0
- data/ext/commonmarker/cmark/build/src/libcmark.a +0 -0
- data/ext/commonmarker/cmark/build/src/libcmark.dylib +0 -0
- data/ext/commonmarker/cmark/build/src/libcmark.pc +10 -0
- data/ext/commonmarker/cmark/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/commonmarker/cmark/build/testdir/CMakeFiles/progress.marks +1 -0
- data/ext/commonmarker/cmark/build/testdir/CTestTestfile.cmake +12 -0
- data/ext/commonmarker/cmark/build/testdir/Makefile +181 -0
- data/ext/commonmarker/cmark/build/testdir/cmake_install.cmake +29 -0
- data/ext/commonmarker/cmark/changelog.txt +153 -0
- data/ext/commonmarker/cmark/data/CaseFolding-3.2.0.txt +912 -0
- data/ext/commonmarker/cmark/man/CMakeLists.txt +8 -0
- data/ext/commonmarker/cmark/man/make_man_page.py +131 -0
- data/ext/commonmarker/cmark/man/man1/cmark.1 +54 -0
- data/ext/commonmarker/cmark/man/man3/cmark.3 +583 -0
- data/ext/commonmarker/cmark/nmake.bat +1 -0
- data/ext/commonmarker/cmark/src/CMakeLists.txt +166 -0
- data/ext/commonmarker/cmark/src/bench.h +27 -0
- data/ext/commonmarker/cmark/src/blocks.c +887 -0
- data/ext/commonmarker/cmark/src/buffer.c +381 -0
- data/ext/commonmarker/cmark/src/buffer.h +113 -0
- data/ext/commonmarker/cmark/src/case_fold_switch.inc +2637 -0
- data/ext/commonmarker/cmark/src/chunk.h +110 -0
- data/ext/commonmarker/cmark/src/cmark.c +24 -0
- data/ext/commonmarker/cmark/src/cmark.h +565 -0
- data/ext/commonmarker/cmark/src/cmark_ctype.c +53 -0
- data/ext/commonmarker/cmark/src/cmark_ctype.h +24 -0
- data/ext/commonmarker/cmark/src/cmark_version.h.in +7 -0
- data/ext/commonmarker/cmark/src/commonmark.c +607 -0
- data/ext/commonmarker/cmark/src/config.h.in +23 -0
- data/ext/commonmarker/cmark/src/debug.h +36 -0
- data/ext/commonmarker/cmark/src/houdini.h +52 -0
- data/ext/commonmarker/cmark/src/houdini_href_e.c +107 -0
- data/ext/commonmarker/cmark/src/houdini_html_e.c +81 -0
- data/ext/commonmarker/cmark/src/houdini_html_u.c +116 -0
- data/ext/commonmarker/cmark/src/html.c +322 -0
- data/ext/commonmarker/cmark/src/html_unescape.gperf +2130 -0
- data/ext/commonmarker/cmark/src/html_unescape.h +13375 -0
- data/ext/commonmarker/cmark/src/inlines.c +1147 -0
- data/ext/commonmarker/cmark/src/inlines.h +19 -0
- data/ext/commonmarker/cmark/src/iterator.c +148 -0
- data/ext/commonmarker/cmark/src/iterator.h +25 -0
- data/ext/commonmarker/cmark/src/libcmark.pc.in +10 -0
- data/ext/commonmarker/cmark/src/main.c +191 -0
- data/ext/commonmarker/cmark/src/man.c +287 -0
- data/ext/commonmarker/cmark/src/node.c +873 -0
- data/ext/commonmarker/cmark/src/node.h +82 -0
- data/ext/commonmarker/cmark/src/parser.h +29 -0
- data/ext/commonmarker/cmark/src/references.c +154 -0
- data/ext/commonmarker/cmark/src/references.h +37 -0
- data/ext/commonmarker/cmark/src/scanners.c +15291 -0
- data/ext/commonmarker/cmark/src/scanners.h +41 -0
- data/ext/commonmarker/cmark/src/scanners.re +247 -0
- data/ext/commonmarker/cmark/src/utf8.c +452 -0
- data/ext/commonmarker/cmark/src/utf8.h +22 -0
- data/ext/commonmarker/cmark/src/xml.c +170 -0
- data/ext/commonmarker/cmark/test/CMakeLists.txt +53 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/asterisk +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/attr_generic +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/attr_href +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/attr_xml_lang +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/attr_xmlns +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/backslash +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/backtick +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/colon +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/dashes +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/double_quote +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/entity_builtin +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/entity_decimal +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/entity_external +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/entity_hex +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/equals +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/exclamation +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/greater_than +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/hash +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/hyphen +0 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/indent +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/left_bracket +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/left_paren +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/less_than +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/plus +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/right_bracket +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/right_paren +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/single_quote +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_any +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_brackets +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_cdata +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_dashes +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_dblquotes +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_empty_quotes +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_idrefs +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_parentheses +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/string_pcdata +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_cdata +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_close +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_doctype +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_element +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_entity +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_notation +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_open +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_close +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_exclamation +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_open_q +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_sq2_close +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/tag_xml_q +1 -0
- data/ext/commonmarker/cmark/test/afl_dictionary/underscore +1 -0
- data/ext/commonmarker/cmark/test/afl_test_cases/test.md +36 -0
- data/ext/commonmarker/cmark/test/cmark.py +40 -0
- data/ext/commonmarker/cmark/test/normalize.py +179 -0
- data/ext/commonmarker/cmark/test/pathological_tests.py +63 -0
- data/ext/commonmarker/cmark/test/roundtrip.sh +2 -0
- data/ext/commonmarker/cmark/test/smart_punct.txt +96 -0
- data/ext/commonmarker/cmark/test/spec.txt +7505 -0
- data/ext/commonmarker/cmark/test/spec_tests.py +139 -0
- data/ext/commonmarker/cmark/toolchain-mingw32.cmake +17 -0
- data/ext/commonmarker/cmark/tools/mkcasefold.pl +22 -0
- data/ext/commonmarker/cmark/wrappers/wrapper.lua +239 -0
- data/ext/commonmarker/cmark/wrappers/wrapper.py +37 -0
- data/ext/commonmarker/cmark/wrappers/wrapper.rb +15 -0
- data/ext/commonmarker/cmark/wrappers/wrapper.rkt +190 -0
- data/ext/commonmarker/commonmarker.c +165 -0
- data/ext/commonmarker/commonmarker.h +11 -0
- data/ext/commonmarker/extconf.rb +18 -0
- data/lib/commonmarker/config.rb +20 -0
- data/lib/commonmarker/version.rb +3 -0
- data/lib/commonmarker.rb +588 -0
- data/test/benchmark.rb +30 -0
- data/test/spec_tests.json +4074 -0
- data/test/test_basics.rb +44 -0
- data/test/test_helper.rb +5 -0
- data/test/test_maliciousness.rb +9 -0
- data/test/test_pathological_inputs.rb +52 -0
- data/test/test_spec.rb +20 -0
- metadata +399 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
#ifndef CMARK_NODE_H
|
2
|
+
#define CMARK_NODE_H
|
3
|
+
|
4
|
+
#ifdef __cplusplus
|
5
|
+
extern "C" {
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#include <stdio.h>
|
9
|
+
#include <stdint.h>
|
10
|
+
|
11
|
+
#include "cmark.h"
|
12
|
+
#include "buffer.h"
|
13
|
+
#include "chunk.h"
|
14
|
+
|
15
|
+
typedef struct {
|
16
|
+
cmark_list_type list_type;
|
17
|
+
int marker_offset;
|
18
|
+
int padding;
|
19
|
+
int start;
|
20
|
+
cmark_delim_type delimiter;
|
21
|
+
unsigned char bullet_char;
|
22
|
+
bool tight;
|
23
|
+
} cmark_list;
|
24
|
+
|
25
|
+
typedef struct {
|
26
|
+
cmark_chunk info;
|
27
|
+
cmark_chunk literal;
|
28
|
+
int fence_length;
|
29
|
+
/* fence_offset must be 0-3, so we can use int8_t */
|
30
|
+
int8_t fence_offset;
|
31
|
+
unsigned char fence_char;
|
32
|
+
bool fenced;
|
33
|
+
} cmark_code;
|
34
|
+
|
35
|
+
typedef struct {
|
36
|
+
int level;
|
37
|
+
bool setext;
|
38
|
+
} cmark_header;
|
39
|
+
|
40
|
+
typedef struct {
|
41
|
+
unsigned char *url;
|
42
|
+
unsigned char *title;
|
43
|
+
} cmark_link;
|
44
|
+
|
45
|
+
struct cmark_node {
|
46
|
+
struct cmark_node *next;
|
47
|
+
struct cmark_node *prev;
|
48
|
+
struct cmark_node *parent;
|
49
|
+
struct cmark_node *first_child;
|
50
|
+
struct cmark_node *last_child;
|
51
|
+
|
52
|
+
void *user_data;
|
53
|
+
|
54
|
+
int start_line;
|
55
|
+
int start_column;
|
56
|
+
int end_line;
|
57
|
+
int end_column;
|
58
|
+
|
59
|
+
cmark_node_type type;
|
60
|
+
|
61
|
+
bool open;
|
62
|
+
bool last_line_blank;
|
63
|
+
|
64
|
+
cmark_strbuf string_content;
|
65
|
+
|
66
|
+
union {
|
67
|
+
cmark_chunk literal;
|
68
|
+
cmark_list list;
|
69
|
+
cmark_code code;
|
70
|
+
cmark_header header;
|
71
|
+
cmark_link link;
|
72
|
+
} as;
|
73
|
+
};
|
74
|
+
|
75
|
+
CMARK_EXPORT int
|
76
|
+
cmark_node_check(cmark_node *node, FILE *out);
|
77
|
+
|
78
|
+
#ifdef __cplusplus
|
79
|
+
}
|
80
|
+
#endif
|
81
|
+
|
82
|
+
#endif
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#ifndef CMARK_AST_H
|
2
|
+
#define CMARK_AST_H
|
3
|
+
|
4
|
+
#include <stdio.h>
|
5
|
+
#include "node.h"
|
6
|
+
#include "buffer.h"
|
7
|
+
|
8
|
+
#ifdef __cplusplus
|
9
|
+
extern "C" {
|
10
|
+
#endif
|
11
|
+
|
12
|
+
#define MAX_LINK_LABEL_LENGTH 1000
|
13
|
+
|
14
|
+
struct cmark_parser {
|
15
|
+
struct cmark_reference_map *refmap;
|
16
|
+
struct cmark_node* root;
|
17
|
+
struct cmark_node* current;
|
18
|
+
int line_number;
|
19
|
+
cmark_strbuf *curline;
|
20
|
+
int last_line_length;
|
21
|
+
cmark_strbuf *linebuf;
|
22
|
+
int options;
|
23
|
+
};
|
24
|
+
|
25
|
+
#ifdef __cplusplus
|
26
|
+
}
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#endif
|
@@ -0,0 +1,154 @@
|
|
1
|
+
#include "cmark.h"
|
2
|
+
#include "utf8.h"
|
3
|
+
#include "parser.h"
|
4
|
+
#include "references.h"
|
5
|
+
#include "inlines.h"
|
6
|
+
#include "chunk.h"
|
7
|
+
|
8
|
+
static unsigned int
|
9
|
+
refhash(const unsigned char *link_ref)
|
10
|
+
{
|
11
|
+
unsigned int hash = 0;
|
12
|
+
|
13
|
+
while (*link_ref)
|
14
|
+
hash = (*link_ref++) + (hash << 6) + (hash << 16) - hash;
|
15
|
+
|
16
|
+
return hash;
|
17
|
+
}
|
18
|
+
|
19
|
+
static void reference_free(cmark_reference *ref)
|
20
|
+
{
|
21
|
+
if(ref != NULL) {
|
22
|
+
free(ref->label);
|
23
|
+
free(ref->url);
|
24
|
+
free(ref->title);
|
25
|
+
free(ref);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
// normalize reference: collapse internal whitespace to single space,
|
30
|
+
// remove leading/trailing whitespace, case fold
|
31
|
+
// Return NULL if the reference name is actually empty (i.e. composed
|
32
|
+
// solely from whitespace)
|
33
|
+
static unsigned char *normalize_reference(cmark_chunk *ref)
|
34
|
+
{
|
35
|
+
cmark_strbuf normalized = GH_BUF_INIT;
|
36
|
+
unsigned char *result;
|
37
|
+
|
38
|
+
if(ref == NULL)
|
39
|
+
return NULL;
|
40
|
+
|
41
|
+
if (ref->len == 0)
|
42
|
+
return NULL;
|
43
|
+
|
44
|
+
utf8proc_case_fold(&normalized, ref->data, ref->len);
|
45
|
+
cmark_strbuf_trim(&normalized);
|
46
|
+
cmark_strbuf_normalize_whitespace(&normalized);
|
47
|
+
|
48
|
+
result = cmark_strbuf_detach(&normalized);
|
49
|
+
assert(result);
|
50
|
+
|
51
|
+
if (result[0] == '\0') {
|
52
|
+
free(result);
|
53
|
+
return NULL;
|
54
|
+
}
|
55
|
+
|
56
|
+
return result;
|
57
|
+
}
|
58
|
+
|
59
|
+
static void add_reference(cmark_reference_map *map, cmark_reference* ref)
|
60
|
+
{
|
61
|
+
cmark_reference *t = ref->next = map->table[ref->hash % REFMAP_SIZE];
|
62
|
+
|
63
|
+
while (t) {
|
64
|
+
if (t->hash == ref->hash &&
|
65
|
+
!strcmp((char *)t->label, (char *)ref->label)) {
|
66
|
+
reference_free(ref);
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
|
70
|
+
t = t->next;
|
71
|
+
}
|
72
|
+
|
73
|
+
map->table[ref->hash % REFMAP_SIZE] = ref;
|
74
|
+
}
|
75
|
+
|
76
|
+
void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url,
|
77
|
+
cmark_chunk *title)
|
78
|
+
{
|
79
|
+
cmark_reference *ref;
|
80
|
+
unsigned char *reflabel = normalize_reference(label);
|
81
|
+
|
82
|
+
/* empty reference name, or composed from only whitespace */
|
83
|
+
if (reflabel == NULL)
|
84
|
+
return;
|
85
|
+
|
86
|
+
ref = (cmark_reference *)calloc(1, sizeof(*ref));
|
87
|
+
if(ref != NULL) {
|
88
|
+
ref->label = reflabel;
|
89
|
+
ref->hash = refhash(ref->label);
|
90
|
+
ref->url = cmark_clean_url(url);
|
91
|
+
ref->title = cmark_clean_title(title);
|
92
|
+
ref->next = NULL;
|
93
|
+
|
94
|
+
add_reference(map, ref);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
// Returns reference if refmap contains a reference with matching
|
99
|
+
// label, otherwise NULL.
|
100
|
+
cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label)
|
101
|
+
{
|
102
|
+
cmark_reference *ref = NULL;
|
103
|
+
unsigned char *norm;
|
104
|
+
unsigned int hash;
|
105
|
+
|
106
|
+
if (label->len > MAX_LINK_LABEL_LENGTH)
|
107
|
+
return NULL;
|
108
|
+
|
109
|
+
if (map == NULL)
|
110
|
+
return NULL;
|
111
|
+
|
112
|
+
norm = normalize_reference(label);
|
113
|
+
if (norm == NULL)
|
114
|
+
return NULL;
|
115
|
+
|
116
|
+
hash = refhash(norm);
|
117
|
+
ref = map->table[hash % REFMAP_SIZE];
|
118
|
+
|
119
|
+
while (ref) {
|
120
|
+
if (ref->hash == hash &&
|
121
|
+
!strcmp((char *)ref->label, (char *)norm))
|
122
|
+
break;
|
123
|
+
ref = ref->next;
|
124
|
+
}
|
125
|
+
|
126
|
+
free(norm);
|
127
|
+
return ref;
|
128
|
+
}
|
129
|
+
|
130
|
+
void cmark_reference_map_free(cmark_reference_map *map)
|
131
|
+
{
|
132
|
+
unsigned int i;
|
133
|
+
|
134
|
+
if(map == NULL)
|
135
|
+
return;
|
136
|
+
|
137
|
+
for (i = 0; i < REFMAP_SIZE; ++i) {
|
138
|
+
cmark_reference *ref = map->table[i];
|
139
|
+
cmark_reference *next;
|
140
|
+
|
141
|
+
while (ref) {
|
142
|
+
next = ref->next;
|
143
|
+
reference_free(ref);
|
144
|
+
ref = next;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
free(map);
|
149
|
+
}
|
150
|
+
|
151
|
+
cmark_reference_map *cmark_reference_map_new(void)
|
152
|
+
{
|
153
|
+
return (cmark_reference_map *)calloc(1, sizeof(cmark_reference_map));
|
154
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#ifndef CMARK_REFERENCES_H
|
2
|
+
#define CMARK_REFERENCES_H
|
3
|
+
|
4
|
+
#include "chunk.h"
|
5
|
+
|
6
|
+
#ifdef __cplusplus
|
7
|
+
extern "C" {
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#define REFMAP_SIZE 16
|
11
|
+
|
12
|
+
struct cmark_reference {
|
13
|
+
struct cmark_reference *next;
|
14
|
+
unsigned char *label;
|
15
|
+
unsigned char *url;
|
16
|
+
unsigned char *title;
|
17
|
+
unsigned int hash;
|
18
|
+
};
|
19
|
+
|
20
|
+
typedef struct cmark_reference cmark_reference;
|
21
|
+
|
22
|
+
struct cmark_reference_map {
|
23
|
+
cmark_reference *table[REFMAP_SIZE];
|
24
|
+
};
|
25
|
+
|
26
|
+
typedef struct cmark_reference_map cmark_reference_map;
|
27
|
+
|
28
|
+
cmark_reference_map *cmark_reference_map_new(void);
|
29
|
+
void cmark_reference_map_free(cmark_reference_map *map);
|
30
|
+
cmark_reference* cmark_reference_lookup(cmark_reference_map *map, cmark_chunk *label);
|
31
|
+
extern void cmark_reference_create(cmark_reference_map *map, cmark_chunk *label, cmark_chunk *url, cmark_chunk *title);
|
32
|
+
|
33
|
+
#ifdef __cplusplus
|
34
|
+
}
|
35
|
+
#endif
|
36
|
+
|
37
|
+
#endif
|