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 @@
|
|
1
|
+
`
|
@@ -0,0 +1 @@
|
|
1
|
+
:
|
@@ -0,0 +1 @@
|
|
1
|
+
---
|
@@ -0,0 +1 @@
|
|
1
|
+
"
|
@@ -0,0 +1 @@
|
|
1
|
+
<
|
@@ -0,0 +1 @@
|
|
1
|
+

|
@@ -0,0 +1 @@
|
|
1
|
+
&a;
|
@@ -0,0 +1 @@
|
|
1
|
+

|
@@ -0,0 +1 @@
|
|
1
|
+
===
|
@@ -0,0 +1 @@
|
|
1
|
+
!
|
@@ -0,0 +1 @@
|
|
1
|
+
>
|
@@ -0,0 +1 @@
|
|
1
|
+
#
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
[
|
@@ -0,0 +1 @@
|
|
1
|
+
(
|
@@ -0,0 +1 @@
|
|
1
|
+
<
|
@@ -0,0 +1 @@
|
|
1
|
+
+
|
@@ -0,0 +1 @@
|
|
1
|
+
]
|
@@ -0,0 +1 @@
|
|
1
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
'
|
@@ -0,0 +1 @@
|
|
1
|
+
ANY
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1 @@
|
|
1
|
+
CDATA
|
@@ -0,0 +1 @@
|
|
1
|
+
--
|
@@ -0,0 +1 @@
|
|
1
|
+
""
|
@@ -0,0 +1 @@
|
|
1
|
+
''
|
@@ -0,0 +1 @@
|
|
1
|
+
IDREFS
|
@@ -0,0 +1 @@
|
|
1
|
+
()
|
@@ -0,0 +1 @@
|
|
1
|
+
#PCDATA
|
@@ -0,0 +1 @@
|
|
1
|
+
<![CDATA[
|
@@ -0,0 +1 @@
|
|
1
|
+
</a>
|
@@ -0,0 +1 @@
|
|
1
|
+
<!DOCTYPE
|
@@ -0,0 +1 @@
|
|
1
|
+
<!ELEMENT
|
@@ -0,0 +1 @@
|
|
1
|
+
<!ENTITY
|
@@ -0,0 +1 @@
|
|
1
|
+
<!NOTATION
|
@@ -0,0 +1 @@
|
|
1
|
+
<a>
|
@@ -0,0 +1 @@
|
|
1
|
+
<a />
|
@@ -0,0 +1 @@
|
|
1
|
+
<!
|
@@ -0,0 +1 @@
|
|
1
|
+
<?
|
@@ -0,0 +1 @@
|
|
1
|
+
]]>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml?>
|
@@ -0,0 +1 @@
|
|
1
|
+
_
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# H1
|
2
|
+
|
3
|
+
H2
|
4
|
+
--
|
5
|
+
|
6
|
+
t ☺
|
7
|
+
*b* **em** `c`
|
8
|
+
≥\&\
|
9
|
+
\_e\_
|
10
|
+
|
11
|
+
4) I1
|
12
|
+
|
13
|
+
5) I2
|
14
|
+
> [l](/u "t")
|
15
|
+
>
|
16
|
+
> - [f]
|
17
|
+
> - ![a](/u "t")
|
18
|
+
>
|
19
|
+
>> <ftp://hh>
|
20
|
+
>> <u@hh>
|
21
|
+
|
22
|
+
~~~ l☺
|
23
|
+
cb
|
24
|
+
~~~
|
25
|
+
|
26
|
+
c1
|
27
|
+
c2
|
28
|
+
|
29
|
+
***
|
30
|
+
|
31
|
+
<div>
|
32
|
+
<b>x</b>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
[f]: /u "t"
|
36
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
from ctypes import CDLL, c_char_p, c_long
|
5
|
+
from subprocess import *
|
6
|
+
import platform
|
7
|
+
import os
|
8
|
+
|
9
|
+
def pipe_through_prog(prog, text):
|
10
|
+
p1 = Popen(prog.split(), stdout=PIPE, stdin=PIPE, stderr=PIPE)
|
11
|
+
[result, err] = p1.communicate(input=text.encode('utf-8'))
|
12
|
+
return [p1.returncode, result.decode('utf-8'), err]
|
13
|
+
|
14
|
+
def use_library(lib, text):
|
15
|
+
textbytes = text.encode('utf-8')
|
16
|
+
textlen = len(textbytes)
|
17
|
+
return [0, lib(textbytes, textlen, 0).decode('utf-8'), '']
|
18
|
+
|
19
|
+
class CMark:
|
20
|
+
def __init__(self, prog=None, library_dir=None):
|
21
|
+
self.prog = prog
|
22
|
+
if prog:
|
23
|
+
self.to_html = lambda x: pipe_through_prog(prog, x)
|
24
|
+
else:
|
25
|
+
sysname = platform.system()
|
26
|
+
if sysname == 'Darwin':
|
27
|
+
libname = "libcmark.dylib"
|
28
|
+
elif sysname == 'Windows':
|
29
|
+
libname = "cmark.dll"
|
30
|
+
else:
|
31
|
+
libname = "libcmark.so"
|
32
|
+
if library_dir:
|
33
|
+
libpath = os.path.join(library_dir, libname)
|
34
|
+
else:
|
35
|
+
libpath = os.path.join("build", "src", libname)
|
36
|
+
cmark = CDLL(libpath)
|
37
|
+
markdown = cmark.cmark_markdown_to_html
|
38
|
+
markdown.restype = c_char_p
|
39
|
+
markdown.argtypes = [c_char_p, c_long]
|
40
|
+
self.to_html = lambda x: use_library(markdown, x)
|
@@ -0,0 +1,179 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
from html.parser import HTMLParser, HTMLParseError
|
3
|
+
from html.entities import name2codepoint
|
4
|
+
import sys
|
5
|
+
import re
|
6
|
+
import cgi
|
7
|
+
|
8
|
+
# Normalization code, adapted from
|
9
|
+
# https://github.com/karlcow/markdown-testsuite/
|
10
|
+
significant_attrs = ["alt", "href", "src", "title"]
|
11
|
+
whitespace_re = re.compile('\s+')
|
12
|
+
class MyHTMLParser(HTMLParser):
|
13
|
+
def __init__(self):
|
14
|
+
HTMLParser.__init__(self)
|
15
|
+
self.last = "starttag"
|
16
|
+
self.in_pre = False
|
17
|
+
self.output = ""
|
18
|
+
self.last_tag = ""
|
19
|
+
def handle_data(self, data):
|
20
|
+
after_tag = self.last == "endtag" or self.last == "starttag"
|
21
|
+
after_block_tag = after_tag and self.is_block_tag(self.last_tag)
|
22
|
+
if after_tag and self.last_tag == "br":
|
23
|
+
data = data.lstrip('\n')
|
24
|
+
data = whitespace_re.sub(' ', data)
|
25
|
+
if after_block_tag and not self.in_pre:
|
26
|
+
if self.last == "starttag":
|
27
|
+
data = data.lstrip()
|
28
|
+
elif self.last == "endtag":
|
29
|
+
data = data.strip()
|
30
|
+
self.output += data
|
31
|
+
self.last = "data"
|
32
|
+
def handle_endtag(self, tag):
|
33
|
+
if tag == "pre":
|
34
|
+
self.in_pre = False
|
35
|
+
elif self.is_block_tag(tag):
|
36
|
+
self.output = self.output.rstrip()
|
37
|
+
self.output += "</" + tag + ">"
|
38
|
+
self.last_tag = tag
|
39
|
+
self.last = "endtag"
|
40
|
+
def handle_starttag(self, tag, attrs):
|
41
|
+
if tag == "pre":
|
42
|
+
self.in_pre = True
|
43
|
+
if self.is_block_tag(tag):
|
44
|
+
self.output = self.output.rstrip()
|
45
|
+
self.output += "<" + tag
|
46
|
+
# For now we don't strip out 'extra' attributes, because of
|
47
|
+
# raw HTML test cases.
|
48
|
+
# attrs = filter(lambda attr: attr[0] in significant_attrs, attrs)
|
49
|
+
if attrs:
|
50
|
+
attrs.sort()
|
51
|
+
for (k,v) in attrs:
|
52
|
+
self.output += " " + k
|
53
|
+
if v != None:
|
54
|
+
self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
|
55
|
+
self.output += ">"
|
56
|
+
self.last_tag = tag
|
57
|
+
self.last = "starttag"
|
58
|
+
def handle_startendtag(self, tag, attrs):
|
59
|
+
"""Ignore closing tag for self-closing """
|
60
|
+
self.handle_starttag(tag, attrs)
|
61
|
+
self.last_tag = tag
|
62
|
+
self.last = "endtag"
|
63
|
+
def handle_comment(self, data):
|
64
|
+
self.output += '<!--' + data + '-->'
|
65
|
+
self.last = "comment"
|
66
|
+
def handle_decl(self, data):
|
67
|
+
self.output += '<!' + data + '>'
|
68
|
+
self.last = "decl"
|
69
|
+
def unknown_decl(self, data):
|
70
|
+
self.output += '<!' + data + '>'
|
71
|
+
self.last = "decl"
|
72
|
+
def handle_pi(self,data):
|
73
|
+
self.output += '<?' + data + '>'
|
74
|
+
self.last = "pi"
|
75
|
+
def handle_entityref(self, name):
|
76
|
+
try:
|
77
|
+
c = chr(name2codepoint[name])
|
78
|
+
except KeyError:
|
79
|
+
c = None
|
80
|
+
self.output_char(c, '&' + name + ';')
|
81
|
+
self.last = "ref"
|
82
|
+
def handle_charref(self, name):
|
83
|
+
try:
|
84
|
+
if name.startswith("x"):
|
85
|
+
c = chr(int(name[1:], 16))
|
86
|
+
else:
|
87
|
+
c = chr(int(name))
|
88
|
+
except ValueError:
|
89
|
+
c = None
|
90
|
+
self.output_char(c, '&' + name + ';')
|
91
|
+
self.last = "ref"
|
92
|
+
# Helpers.
|
93
|
+
def output_char(self, c, fallback):
|
94
|
+
if c == '<':
|
95
|
+
self.output += "<"
|
96
|
+
elif c == '>':
|
97
|
+
self.output += ">"
|
98
|
+
elif c == '&':
|
99
|
+
self.output += "&"
|
100
|
+
elif c == '"':
|
101
|
+
self.output += """
|
102
|
+
elif c == None:
|
103
|
+
self.output += fallback
|
104
|
+
else:
|
105
|
+
self.output += c
|
106
|
+
|
107
|
+
def is_block_tag(self,tag):
|
108
|
+
return (tag in ['article', 'header', 'aside', 'hgroup', 'blockquote',
|
109
|
+
'hr', 'iframe', 'body', 'li', 'map', 'button', 'object', 'canvas',
|
110
|
+
'ol', 'caption', 'output', 'col', 'p', 'colgroup', 'pre', 'dd',
|
111
|
+
'progress', 'div', 'section', 'dl', 'table', 'td', 'dt',
|
112
|
+
'tbody', 'embed', 'textarea', 'fieldset', 'tfoot', 'figcaption',
|
113
|
+
'th', 'figure', 'thead', 'footer', 'tr', 'form', 'ul',
|
114
|
+
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'video', 'script', 'style'])
|
115
|
+
|
116
|
+
def normalize_html(html):
|
117
|
+
r"""
|
118
|
+
Return normalized form of HTML which ignores insignificant output
|
119
|
+
differences:
|
120
|
+
|
121
|
+
Multiple inner whitespaces are collapsed to a single space (except
|
122
|
+
in pre tags):
|
123
|
+
|
124
|
+
>>> normalize_html("<p>a \t b</p>")
|
125
|
+
'<p>a b</p>'
|
126
|
+
|
127
|
+
>>> normalize_html("<p>a \t\nb</p>")
|
128
|
+
'<p>a b</p>'
|
129
|
+
|
130
|
+
* Whitespace surrounding block-level tags is removed.
|
131
|
+
|
132
|
+
>>> normalize_html("<p>a b</p>")
|
133
|
+
'<p>a b</p>'
|
134
|
+
|
135
|
+
>>> normalize_html(" <p>a b</p>")
|
136
|
+
'<p>a b</p>'
|
137
|
+
|
138
|
+
>>> normalize_html("<p>a b</p> ")
|
139
|
+
'<p>a b</p>'
|
140
|
+
|
141
|
+
>>> normalize_html("\n\t<p>\n\t\ta b\t\t</p>\n\t")
|
142
|
+
'<p>a b</p>'
|
143
|
+
|
144
|
+
>>> normalize_html("<i>a b</i> ")
|
145
|
+
'<i>a b</i> '
|
146
|
+
|
147
|
+
* Self-closing tags are converted to open tags.
|
148
|
+
|
149
|
+
>>> normalize_html("<br />")
|
150
|
+
'<br>'
|
151
|
+
|
152
|
+
* Attributes are sorted and lowercased.
|
153
|
+
|
154
|
+
>>> normalize_html('<a title="bar" HREF="foo">x</a>')
|
155
|
+
'<a href="foo" title="bar">x</a>'
|
156
|
+
|
157
|
+
* References are converted to unicode, except that '<', '>', '&', and
|
158
|
+
'"' are rendered using entities.
|
159
|
+
|
160
|
+
>>> normalize_html("∀&><"")
|
161
|
+
'\u2200&><"'
|
162
|
+
|
163
|
+
"""
|
164
|
+
html_chunk_re = re.compile("(\<!\[CDATA\[.*?\]\]\>|\<[^>]*\>|[^<]+)")
|
165
|
+
try:
|
166
|
+
parser = MyHTMLParser()
|
167
|
+
# We work around HTMLParser's limitations parsing CDATA
|
168
|
+
# by breaking the input into chunks and passing CDATA chunks
|
169
|
+
# through verbatim.
|
170
|
+
for chunk in re.finditer(html_chunk_re, html):
|
171
|
+
if chunk.group(0)[:8] == "<![CDATA":
|
172
|
+
parser.output += chunk.group(0)
|
173
|
+
else:
|
174
|
+
parser.feed(chunk.group(0))
|
175
|
+
parser.close()
|
176
|
+
return parser.output
|
177
|
+
except HTMLParseError as e:
|
178
|
+
sys.stderr.write("Normalization error: " + e.msg + "\n")
|
179
|
+
return html # on error, return unnormalized HTML
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
import re
|
5
|
+
import argparse
|
6
|
+
import sys
|
7
|
+
import platform
|
8
|
+
from cmark import CMark
|
9
|
+
|
10
|
+
if __name__ == "__main__":
|
11
|
+
parser = argparse.ArgumentParser(description='Run cmark tests.')
|
12
|
+
parser.add_argument('--program', dest='program', nargs='?', default=None,
|
13
|
+
help='program to test')
|
14
|
+
parser.add_argument('--library-dir', dest='library_dir', nargs='?',
|
15
|
+
default=None, help='directory containing dynamic library')
|
16
|
+
args = parser.parse_args(sys.argv[1:])
|
17
|
+
|
18
|
+
cmark = CMark(prog=args.program, library_dir=args.library_dir)
|
19
|
+
|
20
|
+
# list of pairs consisting of input and a regex that must match the output.
|
21
|
+
pathological = {
|
22
|
+
# note - some pythons have limit of 65535 for {num-matches} in re.
|
23
|
+
"nested strong emph":
|
24
|
+
(("*a **a " * 65000) + "b" + (" a** a*" * 65000),
|
25
|
+
re.compile("(<em>a <strong>a ){65000}b( a</strong> a</em>){65000}")),
|
26
|
+
"nested brackets":
|
27
|
+
(("[" * 50000) + "a" + ("]" * 50000),
|
28
|
+
re.compile("\[{50000}a\]{50000}")),
|
29
|
+
"nested block quotes":
|
30
|
+
((("> " * 50000) + "a"),
|
31
|
+
re.compile("(<blockquote>\n){50000}")),
|
32
|
+
"U+0000 in input":
|
33
|
+
("abc\u0000de\u0000",
|
34
|
+
re.compile("abc\ufffd?de\ufffd?"))
|
35
|
+
}
|
36
|
+
|
37
|
+
whitespace_re = re.compile('/s+/')
|
38
|
+
passed = 0
|
39
|
+
errored = 0
|
40
|
+
failed = 0
|
41
|
+
|
42
|
+
print("Testing pathological cases:")
|
43
|
+
for description in pathological:
|
44
|
+
print(description)
|
45
|
+
(inp, regex) = pathological[description]
|
46
|
+
[rc, actual, err] = cmark.to_html(inp)
|
47
|
+
if rc != 0:
|
48
|
+
errored += 1
|
49
|
+
print(description)
|
50
|
+
print("program returned error code %d" % rc)
|
51
|
+
print(err)
|
52
|
+
elif regex.search(actual):
|
53
|
+
passed += 1
|
54
|
+
else:
|
55
|
+
print(description, 'failed')
|
56
|
+
print(repr(actual))
|
57
|
+
failed += 1
|
58
|
+
|
59
|
+
print("%d passed, %d failed, %d errored" % (passed, failed, errored))
|
60
|
+
if (failed == 0 and errored == 0):
|
61
|
+
exit(0)
|
62
|
+
else:
|
63
|
+
exit(1)
|
@@ -0,0 +1,96 @@
|
|
1
|
+
## Smart punctuation
|
2
|
+
|
3
|
+
.
|
4
|
+
"Hello," said the spider.
|
5
|
+
"'Shelob' is my name."
|
6
|
+
.
|
7
|
+
<p>“Hello,” said the spider.
|
8
|
+
“‘Shelob’ is my name.”</p>
|
9
|
+
.
|
10
|
+
|
11
|
+
.
|
12
|
+
'A', 'B', and 'C' are letters.
|
13
|
+
.
|
14
|
+
<p>‘A’, ‘B’, and ‘C’ are letters.</p>
|
15
|
+
.
|
16
|
+
|
17
|
+
.
|
18
|
+
'Oak,' 'elm,' and 'beech' are names of trees.
|
19
|
+
So is 'pine.'
|
20
|
+
.
|
21
|
+
<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees.
|
22
|
+
So is ‘pine.’</p>
|
23
|
+
.
|
24
|
+
|
25
|
+
.
|
26
|
+
'He said, "I want to go."'
|
27
|
+
.
|
28
|
+
<p>‘He said, “I want to go.”’</p>
|
29
|
+
.
|
30
|
+
|
31
|
+
.
|
32
|
+
Were you alive in the 70's?
|
33
|
+
.
|
34
|
+
<p>Were you alive in the 70’s?</p>
|
35
|
+
.
|
36
|
+
|
37
|
+
.
|
38
|
+
Here is some quoted '`code`' and a "[quoted link](url)".
|
39
|
+
.
|
40
|
+
<p>Here is some quoted ‘<code>code</code>’ and a “<a href="url">quoted link</a>”.</p>
|
41
|
+
.
|
42
|
+
|
43
|
+
.
|
44
|
+
'tis the season to be 'jolly'
|
45
|
+
.
|
46
|
+
<p>’tis the season to be ‘jolly’</p>
|
47
|
+
.
|
48
|
+
|
49
|
+
.
|
50
|
+
"A paragraph with no closing quote.
|
51
|
+
|
52
|
+
"Second paragraph by same speaker, in fiction."
|
53
|
+
.
|
54
|
+
<p>“A paragraph with no closing quote.</p>
|
55
|
+
<p>“Second paragraph by same speaker, in fiction.”</p>
|
56
|
+
.
|
57
|
+
|
58
|
+
.
|
59
|
+
\"This is not smart.\"
|
60
|
+
This isn\'t either.
|
61
|
+
.
|
62
|
+
<p>"This is not smart."
|
63
|
+
This isn't either.</p>
|
64
|
+
.
|
65
|
+
|
66
|
+
.
|
67
|
+
Some dashes: one---two ---
|
68
|
+
three---four --- five.
|
69
|
+
.
|
70
|
+
<p>Some dashes: one—two —
|
71
|
+
three—four — five.</p>
|
72
|
+
.
|
73
|
+
|
74
|
+
.
|
75
|
+
Escaped dashes: \-- \-\-\-.
|
76
|
+
.
|
77
|
+
<p>Escaped dashes: -- ---.</p>
|
78
|
+
.
|
79
|
+
|
80
|
+
.
|
81
|
+
Dashes between numbers: 5--7, 255--66, 1987--1999.
|
82
|
+
.
|
83
|
+
<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>
|
84
|
+
.
|
85
|
+
|
86
|
+
.
|
87
|
+
Ellipses...and...and....
|
88
|
+
.
|
89
|
+
<p>Ellipses…and…and….</p>
|
90
|
+
.
|
91
|
+
|
92
|
+
.
|
93
|
+
No ellipses\.\.\.
|
94
|
+
.
|
95
|
+
<p>No ellipses...</p>
|
96
|
+
.
|