commonmarker 0.17.7 → 0.17.7.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 +4 -4
- data/commonmarker.gemspec +1 -1
- data/lib/commonmarker/version.rb +1 -1
- metadata +2 -335
- data/ext/commonmarker/cmark-upstream/CMakeLists.txt +0 -44
- data/ext/commonmarker/cmark-upstream/COPYING +0 -170
- data/ext/commonmarker/cmark-upstream/FindAsan.cmake +0 -74
- data/ext/commonmarker/cmark-upstream/Makefile +0 -226
- data/ext/commonmarker/cmark-upstream/Makefile.nmake +0 -36
- data/ext/commonmarker/cmark-upstream/README.md +0 -206
- data/ext/commonmarker/cmark-upstream/api_test/CMakeLists.txt +0 -26
- data/ext/commonmarker/cmark-upstream/api_test/cplusplus.cpp +0 -15
- data/ext/commonmarker/cmark-upstream/api_test/cplusplus.h +0 -16
- data/ext/commonmarker/cmark-upstream/api_test/harness.c +0 -110
- data/ext/commonmarker/cmark-upstream/api_test/harness.h +0 -35
- data/ext/commonmarker/cmark-upstream/api_test/main.c +0 -1116
- data/ext/commonmarker/cmark-upstream/appveyor.yml +0 -17
- data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-flat.md +0 -16
- data/ext/commonmarker/cmark-upstream/bench/samples/block-bq-nested.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/block-code.md +0 -11
- data/ext/commonmarker/cmark-upstream/bench/samples/block-fences.md +0 -14
- data/ext/commonmarker/cmark-upstream/bench/samples/block-heading.md +0 -9
- data/ext/commonmarker/cmark-upstream/bench/samples/block-hr.md +0 -10
- data/ext/commonmarker/cmark-upstream/bench/samples/block-html.md +0 -32
- data/ext/commonmarker/cmark-upstream/bench/samples/block-lheading.md +0 -8
- data/ext/commonmarker/cmark-upstream/bench/samples/block-list-flat.md +0 -67
- data/ext/commonmarker/cmark-upstream/bench/samples/block-list-nested.md +0 -36
- data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-flat.md +0 -15
- data/ext/commonmarker/cmark-upstream/bench/samples/block-ref-nested.md +0 -17
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-autolink.md +0 -14
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-backticks.md +0 -3
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-flat.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-nested.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-em-worst.md +0 -5
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-entity.md +0 -11
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-escape.md +0 -15
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-html.md +0 -44
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-flat.md +0 -23
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-links-nested.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/inline-newlines.md +0 -24
- data/ext/commonmarker/cmark-upstream/bench/samples/lorem1.md +0 -13
- data/ext/commonmarker/cmark-upstream/bench/samples/rawtabs.md +0 -18
- data/ext/commonmarker/cmark-upstream/bench/statistics.py +0 -595
- data/ext/commonmarker/cmark-upstream/bench/stats.py +0 -19
- data/ext/commonmarker/cmark-upstream/benchmarks.md +0 -33
- data/ext/commonmarker/cmark-upstream/build/CMakeCache.txt +0 -478
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCCompiler.cmake +0 -71
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CMakeCXXCompiler.cmake +0 -73
- 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 +0 -15
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdC/CMakeCCompilerId.c +0 -567
- 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 +0 -539
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/3.9.6/CompilerIdCXX/a.out +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeError.log +0 -18
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/CMakeOutput.log +0 -709
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile.cmake +0 -157
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/Makefile2 +0 -391
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/TargetDirectories.txt +0 -48
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/cmake.check_cache +0 -1
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.bin +0 -0
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.c +0 -34
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/feature_tests.cxx +0 -405
- data/ext/commonmarker/cmark-upstream/build/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/CTestTestfile.cmake +0 -11
- data/ext/commonmarker/cmark-upstream/build/Makefile +0 -280
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/C.includecache +0 -134
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/CXX.includecache +0 -38
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/DependInfo.cmake +0 -38
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/build.make +0 -169
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/cmake_clean.cmake +0 -12
- 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 +0 -28
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/depend.make +0 -28
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/api_test.dir/flags.make +0 -17
- 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 +0 -1
- 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 +0 -5
- data/ext/commonmarker/cmark-upstream/build/api_test/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/api_test/Makefile +0 -302
- data/ext/commonmarker/cmark-upstream/build/api_test/api_test +0 -0
- data/ext/commonmarker/cmark-upstream/build/api_test/cmake_install.cmake +0 -29
- data/ext/commonmarker/cmark-upstream/build/cmake_install.cmake +0 -49
- data/ext/commonmarker/cmark-upstream/build/compile_commands.json +0 -352
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions-release.cmake +0 -30
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/Export/lib/cmake-gfmextensions/cmark-gfmextensions.cmake +0 -108
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/C.includecache +0 -246
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/DependInfo.cmake +0 -36
- 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 +0 -253
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/cmake_clean.cmake +0 -16
- 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 +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/depend.make +0 -96
- 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 +0 -10
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/link.txt +0 -1
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions.dir/progress.make +0 -8
- 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 +0 -246
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/DependInfo.cmake +0 -29
- 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 +0 -249
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean.cmake +0 -15
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/cmake_clean_target.cmake +0 -3
- 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 +0 -96
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/depend.make +0 -96
- 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 +0 -10
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/link.txt +0 -2
- data/ext/commonmarker/cmark-upstream/build/extensions/CMakeFiles/libcmark-gfmextensions_static.dir/progress.make +0 -8
- 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 +0 -1
- data/ext/commonmarker/cmark-upstream/build/extensions/Makefile +0 -426
- data/ext/commonmarker/cmark-upstream/build/extensions/cmake_install.cmake +0 -84
- data/ext/commonmarker/cmark-upstream/build/extensions/cmarkextensions_export.h +0 -42
- 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 +0 -1
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/man/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/man/Makefile +0 -196
- data/ext/commonmarker/cmark-upstream/build/man/cmake_install.cmake +0 -37
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm-release.cmake +0 -38
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/Export/lib/cmake/cmark-gfm.cmake +0 -95
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/C.includecache +0 -156
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/DependInfo.cmake +0 -30
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/build.make +0 -115
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/cmake_clean.cmake +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.internal +0 -20
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/depend.make +0 -20
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/flags.make +0 -10
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/cmark-gfm.dir/link.txt +0 -1
- 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 +0 -3
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/C.includecache +0 -612
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/DependInfo.cmake +0 -60
- 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 +0 -819
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/cmake_clean.cmake +0 -37
- 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 +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/depend.make +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm.dir/flags.make +0 -10
- 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 +0 -1
- 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 +0 -29
- 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 +0 -612
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/DependInfo.cmake +0 -54
- 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 +0 -816
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean.cmake +0 -36
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/cmake_clean_target.cmake +0 -3
- 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 +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/depend.make +0 -319
- data/ext/commonmarker/cmark-upstream/build/src/CMakeFiles/libcmark-gfm_static.dir/flags.make +0 -10
- 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 +0 -2
- 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 +0 -29
- 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 +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/Makefile +0 -1165
- data/ext/commonmarker/cmark-upstream/build/src/cmake_install.cmake +0 -97
- data/ext/commonmarker/cmark-upstream/build/src/cmark-gfm +0 -0
- data/ext/commonmarker/cmark-upstream/build/src/cmark_export.h +0 -42
- data/ext/commonmarker/cmark-upstream/build/src/cmark_version.h +0 -8
- data/ext/commonmarker/cmark-upstream/build/src/config.h +0 -76
- 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 +0 -1
- data/ext/commonmarker/cmark-upstream/build/src/libcmark-gfm.pc +0 -10
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/CMakeDirectoryInformation.cmake +0 -16
- data/ext/commonmarker/cmark-upstream/build/testdir/CMakeFiles/progress.marks +0 -1
- data/ext/commonmarker/cmark-upstream/build/testdir/CTestTestfile.cmake +0 -17
- data/ext/commonmarker/cmark-upstream/build/testdir/Makefile +0 -196
- data/ext/commonmarker/cmark-upstream/build/testdir/cmake_install.cmake +0 -29
- data/ext/commonmarker/cmark-upstream/changelog.txt +0 -964
- data/ext/commonmarker/cmark-upstream/data/CaseFolding.txt +0 -1495
- data/ext/commonmarker/cmark-upstream/extensions/CMakeLists.txt +0 -124
- data/ext/commonmarker/cmark-upstream/extensions/autolink.c +0 -421
- data/ext/commonmarker/cmark-upstream/extensions/autolink.h +0 -8
- data/ext/commonmarker/cmark-upstream/extensions/core-extensions.c +0 -25
- data/ext/commonmarker/cmark-upstream/extensions/core-extensions.h +0 -25
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.c +0 -941
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.h +0 -22
- data/ext/commonmarker/cmark-upstream/extensions/ext_scanners.re +0 -74
- data/ext/commonmarker/cmark-upstream/extensions/strikethrough.c +0 -157
- data/ext/commonmarker/cmark-upstream/extensions/strikethrough.h +0 -9
- data/ext/commonmarker/cmark-upstream/extensions/table.c +0 -683
- data/ext/commonmarker/cmark-upstream/extensions/table.h +0 -8
- data/ext/commonmarker/cmark-upstream/extensions/tagfilter.c +0 -60
- data/ext/commonmarker/cmark-upstream/extensions/tagfilter.h +0 -8
- data/ext/commonmarker/cmark-upstream/man/CMakeLists.txt +0 -10
- data/ext/commonmarker/cmark-upstream/man/make_man_page.py +0 -133
- data/ext/commonmarker/cmark-upstream/man/man1/cmark-gfm.1 +0 -78
- data/ext/commonmarker/cmark-upstream/man/man3/cmark-gfm.3 +0 -989
- data/ext/commonmarker/cmark-upstream/nmake.bat +0 -1
- data/ext/commonmarker/cmark-upstream/src/CMakeLists.txt +0 -224
- data/ext/commonmarker/cmark-upstream/src/arena.c +0 -103
- data/ext/commonmarker/cmark-upstream/src/blocks.c +0 -1519
- data/ext/commonmarker/cmark-upstream/src/buffer.c +0 -279
- data/ext/commonmarker/cmark-upstream/src/buffer.h +0 -116
- data/ext/commonmarker/cmark-upstream/src/case_fold_switch.inc +0 -4327
- data/ext/commonmarker/cmark-upstream/src/chunk.h +0 -136
- data/ext/commonmarker/cmark-upstream/src/cmark.c +0 -55
- data/ext/commonmarker/cmark-upstream/src/cmark.h +0 -789
- data/ext/commonmarker/cmark-upstream/src/cmark_ctype.c +0 -44
- data/ext/commonmarker/cmark-upstream/src/cmark_ctype.h +0 -33
- data/ext/commonmarker/cmark-upstream/src/cmark_extension_api.h +0 -719
- data/ext/commonmarker/cmark-upstream/src/cmark_version.h.in +0 -8
- data/ext/commonmarker/cmark-upstream/src/commonmark.c +0 -508
- data/ext/commonmarker/cmark-upstream/src/config.h.in +0 -76
- data/ext/commonmarker/cmark-upstream/src/entities.inc +0 -2138
- data/ext/commonmarker/cmark-upstream/src/footnotes.c +0 -40
- data/ext/commonmarker/cmark-upstream/src/footnotes.h +0 -25
- data/ext/commonmarker/cmark-upstream/src/houdini.h +0 -57
- data/ext/commonmarker/cmark-upstream/src/houdini_href_e.c +0 -100
- data/ext/commonmarker/cmark-upstream/src/houdini_html_e.c +0 -66
- data/ext/commonmarker/cmark-upstream/src/houdini_html_u.c +0 -149
- data/ext/commonmarker/cmark-upstream/src/html.c +0 -457
- data/ext/commonmarker/cmark-upstream/src/html.h +0 -27
- data/ext/commonmarker/cmark-upstream/src/inlines.c +0 -1594
- data/ext/commonmarker/cmark-upstream/src/inlines.h +0 -29
- data/ext/commonmarker/cmark-upstream/src/iterator.c +0 -159
- data/ext/commonmarker/cmark-upstream/src/iterator.h +0 -27
- data/ext/commonmarker/cmark-upstream/src/latex.c +0 -466
- data/ext/commonmarker/cmark-upstream/src/libcmark-gfm.pc.in +0 -10
- data/ext/commonmarker/cmark-upstream/src/linked_list.c +0 -37
- data/ext/commonmarker/cmark-upstream/src/main.c +0 -276
- data/ext/commonmarker/cmark-upstream/src/man.c +0 -278
- data/ext/commonmarker/cmark-upstream/src/map.c +0 -122
- data/ext/commonmarker/cmark-upstream/src/map.h +0 -42
- data/ext/commonmarker/cmark-upstream/src/node.c +0 -965
- data/ext/commonmarker/cmark-upstream/src/node.h +0 -116
- data/ext/commonmarker/cmark-upstream/src/parser.h +0 -57
- data/ext/commonmarker/cmark-upstream/src/plaintext.c +0 -213
- data/ext/commonmarker/cmark-upstream/src/plugin.c +0 -36
- data/ext/commonmarker/cmark-upstream/src/plugin.h +0 -34
- data/ext/commonmarker/cmark-upstream/src/references.c +0 -42
- data/ext/commonmarker/cmark-upstream/src/references.h +0 -26
- data/ext/commonmarker/cmark-upstream/src/registry.c +0 -63
- data/ext/commonmarker/cmark-upstream/src/registry.h +0 -24
- data/ext/commonmarker/cmark-upstream/src/render.c +0 -202
- data/ext/commonmarker/cmark-upstream/src/render.h +0 -63
- data/ext/commonmarker/cmark-upstream/src/scanners.c +0 -18195
- data/ext/commonmarker/cmark-upstream/src/scanners.h +0 -64
- data/ext/commonmarker/cmark-upstream/src/scanners.re +0 -341
- data/ext/commonmarker/cmark-upstream/src/syntax_extension.c +0 -139
- data/ext/commonmarker/cmark-upstream/src/syntax_extension.h +0 -32
- data/ext/commonmarker/cmark-upstream/src/utf8.c +0 -317
- data/ext/commonmarker/cmark-upstream/src/utf8.h +0 -35
- data/ext/commonmarker/cmark-upstream/src/xml.c +0 -174
- data/ext/commonmarker/cmark-upstream/suppressions +0 -10
- data/ext/commonmarker/cmark-upstream/test/CMakeLists.txt +0 -98
- data/ext/commonmarker/cmark-upstream/test/afl_test_cases/test.md +0 -49
- data/ext/commonmarker/cmark-upstream/test/cmark-fuzz.c +0 -28
- data/ext/commonmarker/cmark-upstream/test/cmark.py +0 -103
- data/ext/commonmarker/cmark-upstream/test/entity_tests.py +0 -67
- data/ext/commonmarker/cmark-upstream/test/extensions.txt +0 -674
- data/ext/commonmarker/cmark-upstream/test/fuzzing_dictionary +0 -49
- data/ext/commonmarker/cmark-upstream/test/normalize.py +0 -194
- data/ext/commonmarker/cmark-upstream/test/pathological_tests.py +0 -145
- data/ext/commonmarker/cmark-upstream/test/regression.txt +0 -128
- data/ext/commonmarker/cmark-upstream/test/roundtrip_tests.py +0 -50
- data/ext/commonmarker/cmark-upstream/test/run-cmark-fuzz +0 -4
- data/ext/commonmarker/cmark-upstream/test/smart_punct.txt +0 -177
- data/ext/commonmarker/cmark-upstream/test/spec.txt +0 -9919
- data/ext/commonmarker/cmark-upstream/test/spec_tests.py +0 -152
- data/ext/commonmarker/cmark-upstream/toolchain-mingw32.cmake +0 -17
- data/ext/commonmarker/cmark-upstream/tools/Dockerfile +0 -41
- data/ext/commonmarker/cmark-upstream/tools/appveyor-build.bat +0 -13
- data/ext/commonmarker/cmark-upstream/tools/make_entities_inc.py +0 -32
- data/ext/commonmarker/cmark-upstream/tools/mkcasefold.pl +0 -22
- data/ext/commonmarker/cmark-upstream/why-cmark-and-not-x.md +0 -104
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.js +0 -6
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.py +0 -37
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rb +0 -15
- data/ext/commonmarker/cmark-upstream/wrappers/wrapper.rkt +0 -190
@@ -1,10 +0,0 @@
|
|
1
|
-
prefix=@CMAKE_INSTALL_PREFIX@
|
2
|
-
exec_prefix=@CMAKE_INSTALL_PREFIX@
|
3
|
-
libdir=@CMAKE_INSTALL_PREFIX@/@libdir@
|
4
|
-
includedir=@CMAKE_INSTALL_PREFIX@/include
|
5
|
-
|
6
|
-
Name: libcmark-gfm
|
7
|
-
Description: CommonMark parsing, rendering, and manipulation with GitHub Flavored Markdown extensions
|
8
|
-
Version: @PROJECT_VERSION@
|
9
|
-
Libs: -L${libdir} -lcmark-gfm
|
10
|
-
Cflags: -I${includedir}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
#include <stdlib.h>
|
2
|
-
|
3
|
-
#include "cmark.h"
|
4
|
-
|
5
|
-
cmark_llist *cmark_llist_append(cmark_mem *mem, cmark_llist *head, void *data) {
|
6
|
-
cmark_llist *tmp;
|
7
|
-
cmark_llist *new_node = (cmark_llist *) mem->calloc(1, sizeof(cmark_llist));
|
8
|
-
|
9
|
-
new_node->data = data;
|
10
|
-
new_node->next = NULL;
|
11
|
-
|
12
|
-
if (!head)
|
13
|
-
return new_node;
|
14
|
-
|
15
|
-
for (tmp = head; tmp->next; tmp=tmp->next);
|
16
|
-
|
17
|
-
tmp->next = new_node;
|
18
|
-
|
19
|
-
return head;
|
20
|
-
}
|
21
|
-
|
22
|
-
void cmark_llist_free_full(cmark_mem *mem, cmark_llist *head, cmark_free_func free_func) {
|
23
|
-
cmark_llist *tmp, *prev;
|
24
|
-
|
25
|
-
for (tmp = head; tmp;) {
|
26
|
-
if (free_func)
|
27
|
-
free_func(mem, tmp->data);
|
28
|
-
|
29
|
-
prev = tmp;
|
30
|
-
tmp = tmp->next;
|
31
|
-
mem->free(prev);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
void cmark_llist_free(cmark_mem *mem, cmark_llist *head) {
|
36
|
-
cmark_llist_free_full(mem, head, NULL);
|
37
|
-
}
|
@@ -1,276 +0,0 @@
|
|
1
|
-
#include <stdlib.h>
|
2
|
-
#include <stdio.h>
|
3
|
-
#include <string.h>
|
4
|
-
#include <errno.h>
|
5
|
-
#include "config.h"
|
6
|
-
#include "memory.h"
|
7
|
-
#include "cmark.h"
|
8
|
-
#include "node.h"
|
9
|
-
#include "cmark_extension_api.h"
|
10
|
-
#include "syntax_extension.h"
|
11
|
-
#include "parser.h"
|
12
|
-
#include "registry.h"
|
13
|
-
|
14
|
-
#include "../extensions/core-extensions.h"
|
15
|
-
|
16
|
-
#if defined(_WIN32) && !defined(__CYGWIN__)
|
17
|
-
#include <io.h>
|
18
|
-
#include <fcntl.h>
|
19
|
-
#endif
|
20
|
-
|
21
|
-
typedef enum {
|
22
|
-
FORMAT_NONE,
|
23
|
-
FORMAT_HTML,
|
24
|
-
FORMAT_XML,
|
25
|
-
FORMAT_MAN,
|
26
|
-
FORMAT_COMMONMARK,
|
27
|
-
FORMAT_PLAINTEXT,
|
28
|
-
FORMAT_LATEX
|
29
|
-
} writer_format;
|
30
|
-
|
31
|
-
void print_usage() {
|
32
|
-
printf("Usage: cmark-gfm [FILE*]\n");
|
33
|
-
printf("Options:\n");
|
34
|
-
printf(" --to, -t FORMAT Specify output format (html, xml, man, "
|
35
|
-
"commonmark, plaintext, latex)\n");
|
36
|
-
printf(" --width WIDTH Specify wrap width (default 0 = nowrap)\n");
|
37
|
-
printf(" --sourcepos Include source position attribute\n");
|
38
|
-
printf(" --hardbreaks Treat newlines as hard line breaks\n");
|
39
|
-
printf(" --nobreaks Render soft line breaks as spaces\n");
|
40
|
-
printf(" --safe Suppress raw HTML and dangerous URLs\n");
|
41
|
-
printf(" --smart Use smart punctuation\n");
|
42
|
-
printf(" --validate-utf8 Replace UTF-8 invalid sequences with U+FFFD\n");
|
43
|
-
printf(" --github-pre-lang Use GitHub-style <pre lang> for code blocks\n");
|
44
|
-
printf(" --footnotes Parse footnotes\n");
|
45
|
-
printf(" --extension, -e EXTENSION_NAME Specify an extension name to use\n");
|
46
|
-
printf(" --list-extensions List available extensions and quit\n");
|
47
|
-
printf(" --help, -h Print usage information\n");
|
48
|
-
printf(" --version Print version\n");
|
49
|
-
}
|
50
|
-
|
51
|
-
static bool print_document(cmark_node *document, writer_format writer,
|
52
|
-
int options, int width, cmark_parser *parser) {
|
53
|
-
char *result;
|
54
|
-
|
55
|
-
cmark_mem *mem = cmark_get_default_mem_allocator();
|
56
|
-
|
57
|
-
switch (writer) {
|
58
|
-
case FORMAT_HTML:
|
59
|
-
result = cmark_render_html_with_mem(document, options, parser->syntax_extensions, mem);
|
60
|
-
break;
|
61
|
-
case FORMAT_XML:
|
62
|
-
result = cmark_render_xml_with_mem(document, options, mem);
|
63
|
-
break;
|
64
|
-
case FORMAT_MAN:
|
65
|
-
result = cmark_render_man_with_mem(document, options, width, mem);
|
66
|
-
break;
|
67
|
-
case FORMAT_COMMONMARK:
|
68
|
-
result = cmark_render_commonmark_with_mem(document, options, width, mem);
|
69
|
-
break;
|
70
|
-
case FORMAT_PLAINTEXT:
|
71
|
-
result = cmark_render_plaintext_with_mem(document, options, width, mem);
|
72
|
-
break;
|
73
|
-
case FORMAT_LATEX:
|
74
|
-
result = cmark_render_latex_with_mem(document, options, width, mem);
|
75
|
-
break;
|
76
|
-
default:
|
77
|
-
fprintf(stderr, "Unknown format %d\n", writer);
|
78
|
-
return false;
|
79
|
-
}
|
80
|
-
printf("%s", result);
|
81
|
-
mem->free(result);
|
82
|
-
|
83
|
-
return true;
|
84
|
-
}
|
85
|
-
|
86
|
-
static void print_extensions(void) {
|
87
|
-
cmark_llist *syntax_extensions;
|
88
|
-
cmark_llist *tmp;
|
89
|
-
|
90
|
-
printf ("Available extensions:\n");
|
91
|
-
|
92
|
-
cmark_mem *mem = cmark_get_default_mem_allocator();
|
93
|
-
syntax_extensions = cmark_list_syntax_extensions(mem);
|
94
|
-
for (tmp = syntax_extensions; tmp; tmp=tmp->next) {
|
95
|
-
cmark_syntax_extension *ext = (cmark_syntax_extension *) tmp->data;
|
96
|
-
printf("%s\n", ext->name);
|
97
|
-
}
|
98
|
-
|
99
|
-
cmark_llist_free(mem, syntax_extensions);
|
100
|
-
}
|
101
|
-
|
102
|
-
int main(int argc, char *argv[]) {
|
103
|
-
int i, numfps = 0;
|
104
|
-
int *files;
|
105
|
-
char buffer[4096];
|
106
|
-
cmark_parser *parser = NULL;
|
107
|
-
size_t bytes;
|
108
|
-
cmark_node *document = NULL;
|
109
|
-
int width = 0;
|
110
|
-
char *unparsed;
|
111
|
-
writer_format writer = FORMAT_HTML;
|
112
|
-
int options = CMARK_OPT_DEFAULT;
|
113
|
-
int res = 1;
|
114
|
-
|
115
|
-
core_extensions_ensure_registered();
|
116
|
-
|
117
|
-
#if defined(_WIN32) && !defined(__CYGWIN__)
|
118
|
-
_setmode(_fileno(stdin), _O_BINARY);
|
119
|
-
_setmode(_fileno(stdout), _O_BINARY);
|
120
|
-
#endif
|
121
|
-
|
122
|
-
files = (int *)calloc(argc, sizeof(*files));
|
123
|
-
|
124
|
-
for (i = 1; i < argc; i++) {
|
125
|
-
if (strcmp(argv[i], "--version") == 0) {
|
126
|
-
printf("cmark %s", CMARK_VERSION_STRING);
|
127
|
-
printf(" - CommonMark converter\n(C) 2014-2016 John MacFarlane\n");
|
128
|
-
goto success;
|
129
|
-
} else if (strcmp(argv[i], "--list-extensions") == 0) {
|
130
|
-
print_extensions();
|
131
|
-
goto success;
|
132
|
-
} else if (strcmp(argv[i], "--sourcepos") == 0) {
|
133
|
-
options |= CMARK_OPT_SOURCEPOS;
|
134
|
-
} else if (strcmp(argv[i], "--hardbreaks") == 0) {
|
135
|
-
options |= CMARK_OPT_HARDBREAKS;
|
136
|
-
} else if (strcmp(argv[i], "--nobreaks") == 0) {
|
137
|
-
options |= CMARK_OPT_NOBREAKS;
|
138
|
-
} else if (strcmp(argv[i], "--smart") == 0) {
|
139
|
-
options |= CMARK_OPT_SMART;
|
140
|
-
} else if (strcmp(argv[i], "--github-pre-lang") == 0) {
|
141
|
-
options |= CMARK_OPT_GITHUB_PRE_LANG;
|
142
|
-
} else if (strcmp(argv[i], "--footnotes") == 0) {
|
143
|
-
options |= CMARK_OPT_FOOTNOTES;
|
144
|
-
} else if (strcmp(argv[i], "--safe") == 0) {
|
145
|
-
options |= CMARK_OPT_SAFE;
|
146
|
-
} else if (strcmp(argv[i], "--validate-utf8") == 0) {
|
147
|
-
options |= CMARK_OPT_VALIDATE_UTF8;
|
148
|
-
} else if (strcmp(argv[i], "--liberal-html-tag") == 0) {
|
149
|
-
options |= CMARK_OPT_LIBERAL_HTML_TAG;
|
150
|
-
} else if ((strcmp(argv[i], "--help") == 0) ||
|
151
|
-
(strcmp(argv[i], "-h") == 0)) {
|
152
|
-
print_usage();
|
153
|
-
goto success;
|
154
|
-
} else if (strcmp(argv[i], "--width") == 0) {
|
155
|
-
i += 1;
|
156
|
-
if (i < argc) {
|
157
|
-
width = (int)strtol(argv[i], &unparsed, 10);
|
158
|
-
if (unparsed && strlen(unparsed) > 0) {
|
159
|
-
fprintf(stderr, "failed parsing width '%s' at '%s'\n", argv[i],
|
160
|
-
unparsed);
|
161
|
-
goto failure;
|
162
|
-
}
|
163
|
-
} else {
|
164
|
-
fprintf(stderr, "--width requires an argument\n");
|
165
|
-
goto failure;
|
166
|
-
}
|
167
|
-
} else if ((strcmp(argv[i], "-t") == 0) || (strcmp(argv[i], "--to") == 0)) {
|
168
|
-
i += 1;
|
169
|
-
if (i < argc) {
|
170
|
-
if (strcmp(argv[i], "man") == 0) {
|
171
|
-
writer = FORMAT_MAN;
|
172
|
-
} else if (strcmp(argv[i], "html") == 0) {
|
173
|
-
writer = FORMAT_HTML;
|
174
|
-
} else if (strcmp(argv[i], "xml") == 0) {
|
175
|
-
writer = FORMAT_XML;
|
176
|
-
} else if (strcmp(argv[i], "commonmark") == 0) {
|
177
|
-
writer = FORMAT_COMMONMARK;
|
178
|
-
} else if (strcmp(argv[i], "plaintext") == 0) {
|
179
|
-
writer = FORMAT_PLAINTEXT;
|
180
|
-
} else if (strcmp(argv[i], "latex") == 0) {
|
181
|
-
writer = FORMAT_LATEX;
|
182
|
-
} else {
|
183
|
-
fprintf(stderr, "Unknown format %s\n", argv[i]);
|
184
|
-
goto failure;
|
185
|
-
}
|
186
|
-
} else {
|
187
|
-
fprintf(stderr, "No argument provided for %s\n", argv[i - 1]);
|
188
|
-
goto failure;
|
189
|
-
}
|
190
|
-
} else if ((strcmp(argv[i], "-e") == 0) || (strcmp(argv[i], "--extension") == 0)) {
|
191
|
-
i += 1; // Simpler to handle extensions in a second pass, as we can directly register
|
192
|
-
// them with the parser.
|
193
|
-
} else if (*argv[i] == '-') {
|
194
|
-
print_usage();
|
195
|
-
goto failure;
|
196
|
-
} else { // treat as file argument
|
197
|
-
files[numfps++] = i;
|
198
|
-
}
|
199
|
-
}
|
200
|
-
|
201
|
-
#if DEBUG
|
202
|
-
parser = cmark_parser_new(options);
|
203
|
-
#else
|
204
|
-
parser = cmark_parser_new_with_mem(options, cmark_get_arena_mem_allocator());
|
205
|
-
#endif
|
206
|
-
|
207
|
-
for (i = 1; i < argc; i++) {
|
208
|
-
if ((strcmp(argv[i], "-e") == 0) || (strcmp(argv[i], "--extension") == 0)) {
|
209
|
-
i += 1;
|
210
|
-
if (i < argc) {
|
211
|
-
cmark_syntax_extension *syntax_extension = cmark_find_syntax_extension(argv[i]);
|
212
|
-
if (!syntax_extension) {
|
213
|
-
fprintf(stderr, "Unknown extension %s\n", argv[i]);
|
214
|
-
goto failure;
|
215
|
-
}
|
216
|
-
cmark_parser_attach_syntax_extension(parser, syntax_extension);
|
217
|
-
} else {
|
218
|
-
fprintf(stderr, "No argument provided for %s\n", argv[i - 1]);
|
219
|
-
goto failure;
|
220
|
-
}
|
221
|
-
}
|
222
|
-
}
|
223
|
-
|
224
|
-
for (i = 0; i < numfps; i++) {
|
225
|
-
FILE *fp = fopen(argv[files[i]], "rb");
|
226
|
-
if (fp == NULL) {
|
227
|
-
fprintf(stderr, "Error opening file %s: %s\n", argv[files[i]],
|
228
|
-
strerror(errno));
|
229
|
-
goto failure;
|
230
|
-
}
|
231
|
-
|
232
|
-
while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) {
|
233
|
-
cmark_parser_feed(parser, buffer, bytes);
|
234
|
-
if (bytes < sizeof(buffer)) {
|
235
|
-
break;
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
|
-
fclose(fp);
|
240
|
-
}
|
241
|
-
|
242
|
-
if (numfps == 0) {
|
243
|
-
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0) {
|
244
|
-
cmark_parser_feed(parser, buffer, bytes);
|
245
|
-
if (bytes < sizeof(buffer)) {
|
246
|
-
break;
|
247
|
-
}
|
248
|
-
}
|
249
|
-
}
|
250
|
-
|
251
|
-
document = cmark_parser_finish(parser);
|
252
|
-
|
253
|
-
if (!document || !print_document(document, writer, options, width, parser))
|
254
|
-
goto failure;
|
255
|
-
|
256
|
-
success:
|
257
|
-
res = 0;
|
258
|
-
|
259
|
-
failure:
|
260
|
-
|
261
|
-
#if DEBUG
|
262
|
-
if (parser)
|
263
|
-
cmark_parser_free(parser);
|
264
|
-
|
265
|
-
if (document)
|
266
|
-
cmark_node_free(document);
|
267
|
-
#else
|
268
|
-
cmark_arena_reset();
|
269
|
-
#endif
|
270
|
-
|
271
|
-
cmark_release_plugins();
|
272
|
-
|
273
|
-
free(files);
|
274
|
-
|
275
|
-
return res;
|
276
|
-
}
|
@@ -1,278 +0,0 @@
|
|
1
|
-
#include <stdlib.h>
|
2
|
-
#include <stdio.h>
|
3
|
-
#include <string.h>
|
4
|
-
#include <assert.h>
|
5
|
-
|
6
|
-
#include "config.h"
|
7
|
-
#include "cmark.h"
|
8
|
-
#include "node.h"
|
9
|
-
#include "buffer.h"
|
10
|
-
#include "utf8.h"
|
11
|
-
#include "render.h"
|
12
|
-
#include "syntax_extension.h"
|
13
|
-
|
14
|
-
#define OUT(s, wrap, escaping) renderer->out(renderer, node, s, wrap, escaping)
|
15
|
-
#define LIT(s) renderer->out(renderer, node, s, false, LITERAL)
|
16
|
-
#define CR() renderer->cr(renderer)
|
17
|
-
#define BLANKLINE() renderer->blankline(renderer)
|
18
|
-
#define LIST_NUMBER_SIZE 20
|
19
|
-
|
20
|
-
// Functions to convert cmark_nodes to groff man strings.
|
21
|
-
static void S_outc(cmark_renderer *renderer, cmark_node *node,
|
22
|
-
cmark_escaping escape, int32_t c,
|
23
|
-
unsigned char nextc) {
|
24
|
-
(void)(nextc);
|
25
|
-
|
26
|
-
if (escape == LITERAL) {
|
27
|
-
cmark_render_code_point(renderer, c);
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
|
31
|
-
switch (c) {
|
32
|
-
case 46:
|
33
|
-
if (renderer->begin_line) {
|
34
|
-
cmark_render_ascii(renderer, "\\&.");
|
35
|
-
} else {
|
36
|
-
cmark_render_code_point(renderer, c);
|
37
|
-
}
|
38
|
-
break;
|
39
|
-
case 39:
|
40
|
-
if (renderer->begin_line) {
|
41
|
-
cmark_render_ascii(renderer, "\\&'");
|
42
|
-
} else {
|
43
|
-
cmark_render_code_point(renderer, c);
|
44
|
-
}
|
45
|
-
break;
|
46
|
-
case 45:
|
47
|
-
cmark_render_ascii(renderer, "\\-");
|
48
|
-
break;
|
49
|
-
case 92:
|
50
|
-
cmark_render_ascii(renderer, "\\e");
|
51
|
-
break;
|
52
|
-
case 8216: // left single quote
|
53
|
-
cmark_render_ascii(renderer, "\\[oq]");
|
54
|
-
break;
|
55
|
-
case 8217: // right single quote
|
56
|
-
cmark_render_ascii(renderer, "\\[cq]");
|
57
|
-
break;
|
58
|
-
case 8220: // left double quote
|
59
|
-
cmark_render_ascii(renderer, "\\[lq]");
|
60
|
-
break;
|
61
|
-
case 8221: // right double quote
|
62
|
-
cmark_render_ascii(renderer, "\\[rq]");
|
63
|
-
break;
|
64
|
-
case 8212: // em dash
|
65
|
-
cmark_render_ascii(renderer, "\\[em]");
|
66
|
-
break;
|
67
|
-
case 8211: // en dash
|
68
|
-
cmark_render_ascii(renderer, "\\[en]");
|
69
|
-
break;
|
70
|
-
default:
|
71
|
-
cmark_render_code_point(renderer, c);
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
static int S_render_node(cmark_renderer *renderer, cmark_node *node,
|
76
|
-
cmark_event_type ev_type, int options) {
|
77
|
-
cmark_node *tmp;
|
78
|
-
int list_number;
|
79
|
-
bool entering = (ev_type == CMARK_EVENT_ENTER);
|
80
|
-
bool allow_wrap = renderer->width > 0 && !(CMARK_OPT_NOBREAKS & options);
|
81
|
-
|
82
|
-
if (node->extension && node->extension->man_render_func) {
|
83
|
-
node->extension->man_render_func(node->extension, renderer, node, ev_type, options);
|
84
|
-
return 1;
|
85
|
-
}
|
86
|
-
|
87
|
-
switch (node->type) {
|
88
|
-
case CMARK_NODE_DOCUMENT:
|
89
|
-
if (entering) {
|
90
|
-
/* Define a strikethrough macro */
|
91
|
-
/* Commenting out because this makes tests fail
|
92
|
-
LIT(".de ST");
|
93
|
-
CR();
|
94
|
-
LIT(".nr ww \\w'\\\\$1'");
|
95
|
-
CR();
|
96
|
-
LIT("\\Z@\\v'-.25m'\\l'\\\\n[ww]u'@\\\\$1");
|
97
|
-
CR();
|
98
|
-
LIT("..");
|
99
|
-
CR();
|
100
|
-
*/
|
101
|
-
}
|
102
|
-
break;
|
103
|
-
|
104
|
-
case CMARK_NODE_BLOCK_QUOTE:
|
105
|
-
if (entering) {
|
106
|
-
CR();
|
107
|
-
LIT(".RS");
|
108
|
-
CR();
|
109
|
-
} else {
|
110
|
-
CR();
|
111
|
-
LIT(".RE");
|
112
|
-
CR();
|
113
|
-
}
|
114
|
-
break;
|
115
|
-
|
116
|
-
case CMARK_NODE_LIST:
|
117
|
-
break;
|
118
|
-
|
119
|
-
case CMARK_NODE_ITEM:
|
120
|
-
if (entering) {
|
121
|
-
CR();
|
122
|
-
LIT(".IP ");
|
123
|
-
if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) {
|
124
|
-
LIT("\\[bu] 2");
|
125
|
-
} else {
|
126
|
-
list_number = cmark_node_get_list_start(node->parent);
|
127
|
-
tmp = node;
|
128
|
-
while (tmp->prev) {
|
129
|
-
tmp = tmp->prev;
|
130
|
-
list_number += 1;
|
131
|
-
}
|
132
|
-
char list_number_s[LIST_NUMBER_SIZE];
|
133
|
-
snprintf(list_number_s, LIST_NUMBER_SIZE, "\"%d.\" 4", list_number);
|
134
|
-
LIT(list_number_s);
|
135
|
-
}
|
136
|
-
CR();
|
137
|
-
} else {
|
138
|
-
CR();
|
139
|
-
}
|
140
|
-
break;
|
141
|
-
|
142
|
-
case CMARK_NODE_HEADING:
|
143
|
-
if (entering) {
|
144
|
-
CR();
|
145
|
-
LIT(cmark_node_get_heading_level(node) == 1 ? ".SH" : ".SS");
|
146
|
-
CR();
|
147
|
-
} else {
|
148
|
-
CR();
|
149
|
-
}
|
150
|
-
break;
|
151
|
-
|
152
|
-
case CMARK_NODE_CODE_BLOCK:
|
153
|
-
CR();
|
154
|
-
LIT(".IP\n.nf\n\\f[C]\n");
|
155
|
-
OUT(cmark_node_get_literal(node), false, NORMAL);
|
156
|
-
CR();
|
157
|
-
LIT("\\f[]\n.fi");
|
158
|
-
CR();
|
159
|
-
break;
|
160
|
-
|
161
|
-
case CMARK_NODE_HTML_BLOCK:
|
162
|
-
break;
|
163
|
-
|
164
|
-
case CMARK_NODE_CUSTOM_BLOCK:
|
165
|
-
CR();
|
166
|
-
OUT(entering ? cmark_node_get_on_enter(node) : cmark_node_get_on_exit(node),
|
167
|
-
false, LITERAL);
|
168
|
-
CR();
|
169
|
-
break;
|
170
|
-
|
171
|
-
case CMARK_NODE_THEMATIC_BREAK:
|
172
|
-
CR();
|
173
|
-
LIT(".PP\n * * * * *");
|
174
|
-
CR();
|
175
|
-
break;
|
176
|
-
|
177
|
-
case CMARK_NODE_PARAGRAPH:
|
178
|
-
if (entering) {
|
179
|
-
// no blank line if first paragraph in list:
|
180
|
-
if (node->parent && node->parent->type == CMARK_NODE_ITEM &&
|
181
|
-
node->prev == NULL) {
|
182
|
-
// no blank line or .PP
|
183
|
-
} else {
|
184
|
-
CR();
|
185
|
-
LIT(".PP");
|
186
|
-
CR();
|
187
|
-
}
|
188
|
-
} else {
|
189
|
-
CR();
|
190
|
-
}
|
191
|
-
break;
|
192
|
-
|
193
|
-
case CMARK_NODE_TEXT:
|
194
|
-
OUT(cmark_node_get_literal(node), allow_wrap, NORMAL);
|
195
|
-
break;
|
196
|
-
|
197
|
-
case CMARK_NODE_LINEBREAK:
|
198
|
-
LIT(".PD 0\n.P\n.PD");
|
199
|
-
CR();
|
200
|
-
break;
|
201
|
-
|
202
|
-
case CMARK_NODE_SOFTBREAK:
|
203
|
-
if (options & CMARK_OPT_HARDBREAKS) {
|
204
|
-
LIT(".PD 0\n.P\n.PD");
|
205
|
-
CR();
|
206
|
-
} else if (renderer->width == 0 && !(CMARK_OPT_NOBREAKS & options)) {
|
207
|
-
CR();
|
208
|
-
} else {
|
209
|
-
OUT(" ", allow_wrap, LITERAL);
|
210
|
-
}
|
211
|
-
break;
|
212
|
-
|
213
|
-
case CMARK_NODE_CODE:
|
214
|
-
LIT("\\f[C]");
|
215
|
-
OUT(cmark_node_get_literal(node), allow_wrap, NORMAL);
|
216
|
-
LIT("\\f[]");
|
217
|
-
break;
|
218
|
-
|
219
|
-
case CMARK_NODE_HTML_INLINE:
|
220
|
-
break;
|
221
|
-
|
222
|
-
case CMARK_NODE_CUSTOM_INLINE:
|
223
|
-
OUT(entering ? cmark_node_get_on_enter(node) : cmark_node_get_on_exit(node),
|
224
|
-
false, LITERAL);
|
225
|
-
break;
|
226
|
-
|
227
|
-
case CMARK_NODE_STRONG:
|
228
|
-
if (entering) {
|
229
|
-
LIT("\\f[B]");
|
230
|
-
} else {
|
231
|
-
LIT("\\f[]");
|
232
|
-
}
|
233
|
-
break;
|
234
|
-
|
235
|
-
case CMARK_NODE_EMPH:
|
236
|
-
if (entering) {
|
237
|
-
LIT("\\f[I]");
|
238
|
-
} else {
|
239
|
-
LIT("\\f[]");
|
240
|
-
}
|
241
|
-
break;
|
242
|
-
|
243
|
-
case CMARK_NODE_LINK:
|
244
|
-
if (!entering) {
|
245
|
-
LIT(" (");
|
246
|
-
OUT(cmark_node_get_url(node), allow_wrap, URL);
|
247
|
-
LIT(")");
|
248
|
-
}
|
249
|
-
break;
|
250
|
-
|
251
|
-
case CMARK_NODE_IMAGE:
|
252
|
-
if (entering) {
|
253
|
-
LIT("[IMAGE: ");
|
254
|
-
} else {
|
255
|
-
LIT("]");
|
256
|
-
}
|
257
|
-
break;
|
258
|
-
|
259
|
-
case CMARK_NODE_FOOTNOTE_DEFINITION:
|
260
|
-
case CMARK_NODE_FOOTNOTE_REFERENCE:
|
261
|
-
// TODO
|
262
|
-
break;
|
263
|
-
|
264
|
-
default:
|
265
|
-
assert(false);
|
266
|
-
break;
|
267
|
-
}
|
268
|
-
|
269
|
-
return 1;
|
270
|
-
}
|
271
|
-
|
272
|
-
char *cmark_render_man(cmark_node *root, int options, int width) {
|
273
|
-
return cmark_render_man_with_mem(root, options, width, cmark_node_mem(root));
|
274
|
-
}
|
275
|
-
|
276
|
-
char *cmark_render_man_with_mem(cmark_node *root, int options, int width, cmark_mem *mem) {
|
277
|
-
return cmark_render(mem, root, options, width, S_outc, S_render_node);
|
278
|
-
}
|