apex-ruby 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +119 -0
- data/apex-ruby.gemspec +31 -0
- data/ext/apex_ext/apex_ext.c +215 -0
- data/ext/apex_ext/apex_src/BENCHMARK.md +32 -0
- data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +67 -0
- data/ext/apex_ext/apex_src/CHANGELOG.md +2454 -0
- data/ext/apex_ext/apex_src/CMakeLists.txt +454 -0
- data/ext/apex_ext/apex_src/Dockerfile.linux-build +15 -0
- data/ext/apex_ext/apex_src/Formula/apex.rb +38 -0
- data/ext/apex_ext/apex_src/Info.plist.in +27 -0
- data/ext/apex_ext/apex_src/LICENSE +21 -0
- data/ext/apex_ext/apex_src/Package.swift +160 -0
- data/ext/apex_ext/apex_src/PackageSupport/README.md +17 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_export.h +20 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark-gfm_version.h +14 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +4 -0
- data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/config.h +41 -0
- data/ext/apex_ext/apex_src/README.md +452 -0
- data/ext/apex_ext/apex_src/VERSION +1 -0
- data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
- data/ext/apex_ext/apex_src/apex-plugins.json.example +20 -0
- data/ext/apex_ext/apex_src/apex.pc.in +11 -0
- data/ext/apex_ext/apex_src/cli/main.c +2720 -0
- data/ext/apex_ext/apex_src/debug_test.sh +22 -0
- data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +451 -0
- data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +166 -0
- data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +220 -0
- data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +501 -0
- data/ext/apex_ext/apex_src/docs/DEBUGGING.md +73 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +391 -0
- data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +237 -0
- data/ext/apex_ext/apex_src/docs/FUTURE_FEATURES.md +456 -0
- data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +210 -0
- data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +344 -0
- data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +144 -0
- data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +278 -0
- data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +321 -0
- data/ext/apex_ext/apex_src/docs/PROGRESS.md +167 -0
- data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +174 -0
- data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +243 -0
- data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +316 -0
- data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +803 -0
- data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +91 -0
- data/ext/apex_ext/apex_src/documentation/README.md +160 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +365 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +24 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +1737 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +1420 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +3574 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +1603 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +910 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +1003 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +1308 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +1078 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +1622 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +1168 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +1698 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +1531 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +1980 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +1368 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +1151 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +2861 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +3981 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +1454 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +1200 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +2066 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/tempOptimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +22 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +914 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +399 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +772 -0
- data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +678 -0
- data/ext/apex_ext/apex_src/documentation/generate_docset.rb +873 -0
- data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +733 -0
- data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +17073 -0
- data/ext/apex_ext/apex_src/documentation/shared_scripts.js +64 -0
- data/ext/apex_ext/apex_src/documentation/shared_styles.css +646 -0
- data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +260 -0
- data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +119 -0
- data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +11 -0
- data/ext/apex_ext/apex_src/examples/example.html +53 -0
- data/ext/apex_ext/apex_src/examples/example.md +85 -0
- data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +158 -0
- data/ext/apex_ext/apex_src/examples/kbd.md +8 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +250 -0
- data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +9 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
- data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
- data/ext/apex_ext/apex_src/include/apex/apex.h +247 -0
- data/ext/apex_ext/apex_src/include/apex/buffer.h +93 -0
- data/ext/apex_ext/apex_src/include/apex/module.modulemap +16 -0
- data/ext/apex_ext/apex_src/include/apex/parser.h +150 -0
- data/ext/apex_ext/apex_src/include/apex/renderer.h +39 -0
- data/ext/apex_ext/apex_src/man/apex-config.5 +374 -0
- data/ext/apex_ext/apex_src/man/apex-config.5.md +260 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7 +456 -0
- data/ext/apex_ext/apex_src/man/apex-plugins.7.md +365 -0
- data/ext/apex_ext/apex_src/man/apex.1 +828 -0
- data/ext/apex_ext/apex_src/man/apex.1.md +643 -0
- data/ext/apex_ext/apex_src/man/apex.1.new +338 -0
- data/ext/apex_ext/apex_src/objc/Apex.swift +237 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.h +117 -0
- data/ext/apex_ext/apex_src/objc/NSString+Apex.m +332 -0
- data/ext/apex_ext/apex_src/src/_README.md +358 -0
- data/ext/apex_ext/apex_src/src/apex.c +6326 -0
- data/ext/apex_ext/apex_src/src/buffer.c +93 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.c +362 -0
- data/ext/apex_ext/apex_src/src/extensions/abbreviations.h +45 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.c +184 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_footnotes.h +50 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.c +1897 -0
- data/ext/apex_ext/apex_src/src/extensions/advanced_tables.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.c +215 -0
- data/ext/apex_ext/apex_src/src/extensions/callouts.h +53 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.c +2042 -0
- data/ext/apex_ext/apex_src/src/extensions/citations.h +163 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.c +329 -0
- data/ext/apex_ext/apex_src/src/extensions/critic.h +48 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.c +1670 -0
- data/ext/apex_ext/apex_src/src/extensions/definition_list.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.c +710 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji.h +38 -0
- data/ext/apex_ext/apex_src/src/extensions/emoji_data.h +942 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.c +925 -0
- data/ext/apex_ext/apex_src/src/extensions/fenced_divs.h +43 -0
- data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +869 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.c +1121 -0
- data/ext/apex_ext/apex_src/src/extensions/grid_tables.h +33 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.c +626 -0
- data/ext/apex_ext/apex_src/src/extensions/header_ids.h +60 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.c +135 -0
- data/ext/apex_ext/apex_src/src/extensions/highlight.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +408 -0
- data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +42 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.c +4084 -0
- data/ext/apex_ext/apex_src/src/extensions/ial.h +145 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.c +1536 -0
- data/ext/apex_ext/apex_src/src/extensions/includes.h +54 -0
- data/ext/apex_ext/apex_src/src/extensions/index.c +967 -0
- data/ext/apex_ext/apex_src/src/extensions/index.h +90 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.c +205 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_footnotes.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.c +332 -0
- data/ext/apex_ext/apex_src/src/extensions/inline_tables.h +13 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.c +248 -0
- data/ext/apex_ext/apex_src/src/extensions/insert.h +18 -0
- data/ext/apex_ext/apex_src/src/extensions/math.c +279 -0
- data/ext/apex_ext/apex_src/src/extensions/math.h +32 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.c +3046 -0
- data/ext/apex_ext/apex_src/src/extensions/metadata.h +125 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +1297 -0
- data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.h +39 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.c +194 -0
- data/ext/apex_ext/apex_src/src/extensions/special_markers.h +29 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.c +405 -0
- data/ext/apex_ext/apex_src/src/extensions/sup_sub.h +16 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.c +468 -0
- data/ext/apex_ext/apex_src/src/extensions/syntax_highlight.h +44 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +2679 -0
- data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.h +23 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.c +255 -0
- data/ext/apex_ext/apex_src/src/extensions/toc.h +34 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.c +624 -0
- data/ext/apex_ext/apex_src/src/extensions/wiki_links.h +58 -0
- data/ext/apex_ext/apex_src/src/html_renderer.c +2762 -0
- data/ext/apex_ext/apex_src/src/html_renderer.h +126 -0
- data/ext/apex_ext/apex_src/src/parser.c +227 -0
- data/ext/apex_ext/apex_src/src/plugins.c +895 -0
- data/ext/apex_ext/apex_src/src/plugins.h +39 -0
- data/ext/apex_ext/apex_src/src/plugins_env.c +187 -0
- data/ext/apex_ext/apex_src/src/plugins_remote.c +263 -0
- data/ext/apex_ext/apex_src/src/pretty_html.c +358 -0
- data/ext/apex_ext/apex_src/src/renderer.c +241 -0
- data/ext/apex_ext/apex_src/src/utf8.c +56 -0
- data/ext/apex_ext/apex_src/test-linux-build.sh +20 -0
- data/ext/apex_ext/apex_src/test.html +103 -0
- data/ext/apex_ext/apex_src/test_coverage.sh +121 -0
- data/ext/apex_ext/apex_src/test_ial_fenced.md +6 -0
- data/ext/apex_ext/apex_src/test_math_norm.py +79 -0
- data/ext/apex_ext/apex_src/test_pandoc_output.html +48 -0
- data/ext/apex_ext/apex_src/test_spm.sh +107 -0
- data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +50 -0
- data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +229 -0
- data/ext/apex_ext/apex_src/tests/CMakeLists.txt +24 -0
- data/ext/apex_ext/apex_src/tests/README.md +146 -0
- data/ext/apex_ext/apex_src/tests/benchmark.sh +113 -0
- data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +166 -0
- data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +31 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +25 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +24 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +33 -0
- data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +26 -0
- data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +260 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +6 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +9 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +620 -0
- data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +177 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +3 -0
- data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +74 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +60 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +27 -0
- data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +94 -0
- data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +16 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +5 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +2 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +8 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +4 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +7 -0
- data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
- data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +1094 -0
- data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +11 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +96 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +43 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +53 -0
- data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +37 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +93 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +38 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +12 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +15 -0
- data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +15 -0
- data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +105 -0
- data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +143 -0
- data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +96 -0
- data/ext/apex_ext/apex_src/tests/gh_api_test.md +6 -0
- data/ext/apex_ext/apex_src/tests/ial_demo.html +186 -0
- data/ext/apex_ext/apex_src/tests/include_code.py +19 -0
- data/ext/apex_ext/apex_src/tests/include_snippet.md +15 -0
- data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +64 -0
- data/ext/apex_ext/apex_src/tests/sample_data.csv +7 -0
- data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +4 -0
- data/ext/apex_ext/apex_src/tests/test_basic.c +74 -0
- data/ext/apex_ext/apex_src/tests/test_extensions.c +2116 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.c +183 -0
- data/ext/apex_ext/apex_src/tests/test_helpers.h +91 -0
- data/ext/apex_ext/apex_src/tests/test_ial.c +282 -0
- data/ext/apex_ext/apex_src/tests/test_links.c +418 -0
- data/ext/apex_ext/apex_src/tests/test_marked_integration.c +265 -0
- data/ext/apex_ext/apex_src/tests/test_metadata.c +908 -0
- data/ext/apex_ext/apex_src/tests/test_output.c +1118 -0
- data/ext/apex_ext/apex_src/tests/test_plugins.c +219 -0
- data/ext/apex_ext/apex_src/tests/test_refs.bib +31 -0
- data/ext/apex_ext/apex_src/tests/test_runner.c +244 -0
- data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +198 -0
- data/ext/apex_ext/apex_src/tests/test_tables.c +862 -0
- data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +9 -0
- data/ext/apex_ext/apex_src/tests/yaml_test.md +13 -0
- data/ext/apex_ext/apex_src/tests.rb +39 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +48 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/COPYING +170 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +74 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +206 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +30 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +111 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +1169 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +21 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +16 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +14 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +3 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +5 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +11 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +23 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +18 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +595 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +19 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +1245 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +1495 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +119 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.c +508 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/autolink.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/cmark-gfm-core-extensions.h +54 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/core-extensions.c +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.c +879 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +92 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.c +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/strikethrough.h +9 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.c +917 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/table.h +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.c +60 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tagfilter.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.c +156 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/tasklist.h +8 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +12 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +91 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +110 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +28 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +133 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +78 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +1041 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +1 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +230 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/arena.c +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/blocks.c +1622 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.c +278 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/buffer.h +116 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/case_fold_switch.inc +4327 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/chunk.h +135 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm-extension_api.h +737 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm.h +833 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +7 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark.c +55 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.c +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark_ctype.h +33 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/commonmark.c +514 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +76 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/entities.inc +2138 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/footnotes.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini.h +57 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_href_e.c +100 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_e.c +66 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/houdini_html_u.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.c +502 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/html.h +27 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.c +1788 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/inlines.h +29 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.c +159 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/iterator.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/latex.c +468 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/linked_list.c +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/main.c +328 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/man.c +274 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.c +129 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/map.h +44 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.c +1045 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/node.h +167 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/parser.h +59 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plaintext.c +218 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.c +36 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/plugin.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.c +43 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/references.h +26 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.c +63 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/registry.h +24 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.c +213 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/render.h +62 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.c +14056 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.h +70 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +365 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.c +149 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/syntax_extension.h +34 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.c +317 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/utf8.h +35 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/xml.c +182 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +10 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +114 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +49 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +58 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +105 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +38 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +920 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +67 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +194 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +160 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +375 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +50 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +4 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +177 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +10212 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +152 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +17 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +41 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +13 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +32 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +22 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +319 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +80 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +104 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +6 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +37 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +15 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +208 -0
- data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +109 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +160 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Changes +372 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/License +20 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +51 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +46 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +89 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +73 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +222 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +26 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +24 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +14 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +2 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +7 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +3 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +17 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +1999 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +77 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +32 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +23 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +1 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +4 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +1393 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +394 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +2358 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +544 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +1416 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +469 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +3598 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +141 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +684 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +27 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +9 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +800 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +1127 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +217 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +202 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +314 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +290 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +327 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +196 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +88 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +63 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +354 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +29 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +10 -0
- data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +16 -0
- data/ext/apex_ext/extconf.rb +103 -0
- data/lib/apex/configurable.rb +46 -0
- data/lib/apex/document.rb +66 -0
- data/lib/apex/version.rb +15 -0
- data/lib/apex.rb +28 -0
- metadata +544 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#include <yaml.h>
|
|
2
|
+
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
|
|
6
|
+
#ifdef NDEBUG
|
|
7
|
+
#undef NDEBUG
|
|
8
|
+
#endif
|
|
9
|
+
#include <assert.h>
|
|
10
|
+
|
|
11
|
+
int
|
|
12
|
+
main(int argc, char *argv[])
|
|
13
|
+
{
|
|
14
|
+
int number;
|
|
15
|
+
|
|
16
|
+
if (argc < 2) {
|
|
17
|
+
printf("Usage: %s file1.yaml ...\n", argv[0]);
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
for (number = 1; number < argc; number ++)
|
|
22
|
+
{
|
|
23
|
+
FILE *file;
|
|
24
|
+
yaml_parser_t parser;
|
|
25
|
+
yaml_token_t token;
|
|
26
|
+
int done = 0;
|
|
27
|
+
int count = 0;
|
|
28
|
+
int error = 0;
|
|
29
|
+
|
|
30
|
+
printf("[%d] Scanning '%s': ", number, argv[number]);
|
|
31
|
+
fflush(stdout);
|
|
32
|
+
|
|
33
|
+
file = fopen(argv[number], "rb");
|
|
34
|
+
assert(file);
|
|
35
|
+
|
|
36
|
+
assert(yaml_parser_initialize(&parser));
|
|
37
|
+
|
|
38
|
+
yaml_parser_set_input_file(&parser, file);
|
|
39
|
+
|
|
40
|
+
while (!done)
|
|
41
|
+
{
|
|
42
|
+
if (!yaml_parser_scan(&parser, &token)) {
|
|
43
|
+
error = 1;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
done = (token.type == YAML_STREAM_END_TOKEN);
|
|
48
|
+
|
|
49
|
+
yaml_token_delete(&token);
|
|
50
|
+
|
|
51
|
+
count ++;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
yaml_parser_delete(&parser);
|
|
55
|
+
|
|
56
|
+
assert(!fclose(file));
|
|
57
|
+
|
|
58
|
+
printf("%s (%d tokens)\n", (error ? "FAILURE" : "SUCCESS"), count);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
#include <yaml.h>
|
|
2
|
+
|
|
3
|
+
YAML_DECLARE(int)
|
|
4
|
+
yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
|
|
5
|
+
|
|
6
|
+
#include <stdlib.h>
|
|
7
|
+
#include <stdio.h>
|
|
8
|
+
|
|
9
|
+
#ifdef NDEBUG
|
|
10
|
+
#undef NDEBUG
|
|
11
|
+
#endif
|
|
12
|
+
#include <assert.h>
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Test cases are stolen from
|
|
16
|
+
* http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
typedef struct {
|
|
20
|
+
char *title;
|
|
21
|
+
char *test;
|
|
22
|
+
int result;
|
|
23
|
+
} test_case;
|
|
24
|
+
|
|
25
|
+
test_case utf8_sequences[] = {
|
|
26
|
+
/* {"title", "test 1|test 2|...|test N!", (0 or 1)}, */
|
|
27
|
+
|
|
28
|
+
{"a simple test", "'test' is '\xd0\xbf\xd1\x80\xd0\xbe\xd0\xb2\xd0\xb5\xd1\x80\xd0\xba\xd0\xb0' in Russian!", 1},
|
|
29
|
+
{"an empty line", "!", 1},
|
|
30
|
+
|
|
31
|
+
{"u-0 is a control character", "\x00!", 0},
|
|
32
|
+
{"u-80 is a control character", "\xc2\x80!", 0},
|
|
33
|
+
{"u-800 is valid", "\xe0\xa0\x80!", 1},
|
|
34
|
+
{"u-10000 is valid", "\xf0\x90\x80\x80!", 1},
|
|
35
|
+
{"5 bytes sequences are not allowed", "\xf8\x88\x80\x80\x80!", 0},
|
|
36
|
+
{"6 bytes sequences are not allowed", "\xfc\x84\x80\x80\x80\x80!", 0},
|
|
37
|
+
|
|
38
|
+
{"u-7f is a control character", "\x7f!", 0},
|
|
39
|
+
{"u-7FF is valid", "\xdf\xbf!", 1},
|
|
40
|
+
{"u-FFFF is a control character", "\xef\xbf\xbf!", 0},
|
|
41
|
+
{"u-1FFFFF is too large", "\xf7\xbf\xbf\xbf!", 0},
|
|
42
|
+
{"u-3FFFFFF is 5 bytes", "\xfb\xbf\xbf\xbf\xbf!", 0},
|
|
43
|
+
{"u-7FFFFFFF is 6 bytes", "\xfd\xbf\xbf\xbf\xbf\xbf!", 0},
|
|
44
|
+
|
|
45
|
+
{"u-D7FF", "\xed\x9f\xbf!", 1},
|
|
46
|
+
{"u-E000", "\xee\x80\x80!", 1},
|
|
47
|
+
{"u-FFFD", "\xef\xbf\xbd!", 1},
|
|
48
|
+
{"u-10FFFF", "\xf4\x8f\xbf\xbf!", 1},
|
|
49
|
+
{"u-110000", "\xf4\x90\x80\x80!", 0},
|
|
50
|
+
|
|
51
|
+
{"first continuation byte", "\x80!", 0},
|
|
52
|
+
{"last continuation byte", "\xbf!", 0},
|
|
53
|
+
|
|
54
|
+
{"2 continuation bytes", "\x80\xbf!", 0},
|
|
55
|
+
{"3 continuation bytes", "\x80\xbf\x80!", 0},
|
|
56
|
+
{"4 continuation bytes", "\x80\xbf\x80\xbf!", 0},
|
|
57
|
+
{"5 continuation bytes", "\x80\xbf\x80\xbf\x80!", 0},
|
|
58
|
+
{"6 continuation bytes", "\x80\xbf\x80\xbf\x80\xbf!", 0},
|
|
59
|
+
{"7 continuation bytes", "\x80\xbf\x80\xbf\x80\xbf\x80!", 0},
|
|
60
|
+
|
|
61
|
+
{"sequence of all 64 possible continuation bytes",
|
|
62
|
+
"\x80|\x81|\x82|\x83|\x84|\x85|\x86|\x87|\x88|\x89|\x8a|\x8b|\x8c|\x8d|\x8e|\x8f|"
|
|
63
|
+
"\x90|\x91|\x92|\x93|\x94|\x95|\x96|\x97|\x98|\x99|\x9a|\x9b|\x9c|\x9d|\x9e|\x9f|"
|
|
64
|
+
"\xa0|\xa1|\xa2|\xa3|\xa4|\xa5|\xa6|\xa7|\xa8|\xa9|\xaa|\xab|\xac|\xad|\xae|\xaf|"
|
|
65
|
+
"\xb0|\xb1|\xb2|\xb3|\xb4|\xb5|\xb6|\xb7|\xb8|\xb9|\xba|\xbb|\xbc|\xbd|\xbe|\xbf!", 0},
|
|
66
|
+
{"32 first bytes of 2-byte sequences {0xc0-0xdf}",
|
|
67
|
+
"\xc0 |\xc1 |\xc2 |\xc3 |\xc4 |\xc5 |\xc6 |\xc7 |\xc8 |\xc9 |\xca |\xcb |\xcc |\xcd |\xce |\xcf |"
|
|
68
|
+
"\xd0 |\xd1 |\xd2 |\xd3 |\xd4 |\xd5 |\xd6 |\xd7 |\xd8 |\xd9 |\xda |\xdb |\xdc |\xdd |\xde |\xdf !", 0},
|
|
69
|
+
{"16 first bytes of 3-byte sequences {0xe0-0xef}",
|
|
70
|
+
"\xe0 |\xe1 |\xe2 |\xe3 |\xe4 |\xe5 |\xe6 |\xe7 |\xe8 |\xe9 |\xea |\xeb |\xec |\xed |\xee |\xef !", 0},
|
|
71
|
+
{"8 first bytes of 4-byte sequences {0xf0-0xf7}", "\xf0 |\xf1 |\xf2 |\xf3 |\xf4 |\xf5 |\xf6 |\xf7 !", 0},
|
|
72
|
+
{"4 first bytes of 5-byte sequences {0xf8-0xfb}", "\xf8 |\xf9 |\xfa |\xfb !", 0},
|
|
73
|
+
{"2 first bytes of 6-byte sequences {0xfc-0xfd}", "\xfc |\xfd !", 0},
|
|
74
|
+
|
|
75
|
+
{"sequences with last byte missing {u-0}",
|
|
76
|
+
"\xc0|\xe0\x80|\xf0\x80\x80|\xf8\x80\x80\x80|\xfc\x80\x80\x80\x80!", 0},
|
|
77
|
+
{"sequences with last byte missing {u-...FF}",
|
|
78
|
+
"\xdf|\xef\xbf|\xf7\xbf\xbf|\xfb\xbf\xbf\xbf|\xfd\xbf\xbf\xbf\xbf!", 0},
|
|
79
|
+
|
|
80
|
+
{"impossible bytes", "\xfe|\xff|\xfe\xfe\xff\xff!", 0},
|
|
81
|
+
|
|
82
|
+
{"overlong sequences {u-2f}",
|
|
83
|
+
"\xc0\xaf|\xe0\x80\xaf|\xf0\x80\x80\xaf|\xf8\x80\x80\x80\xaf|\xfc\x80\x80\x80\x80\xaf!", 0},
|
|
84
|
+
|
|
85
|
+
{"maximum overlong sequences",
|
|
86
|
+
"\xc1\xbf|\xe0\x9f\xbf|\xf0\x8f\xbf\xbf|\xf8\x87\xbf\xbf\xbf|\xfc\x83\xbf\xbf\xbf\xbf!", 0},
|
|
87
|
+
|
|
88
|
+
{"overlong representation of the NUL character",
|
|
89
|
+
"\xc0\x80|\xe0\x80\x80|\xf0\x80\x80\x80|\xf8\x80\x80\x80\x80|\xfc\x80\x80\x80\x80\x80!", 0},
|
|
90
|
+
|
|
91
|
+
{"single UTF-16 surrogates",
|
|
92
|
+
"\xed\xa0\x80|\xed\xad\xbf|\xed\xae\x80|\xed\xaf\xbf|\xed\xb0\x80|\xed\xbe\x80|\xed\xbf\xbf!", 0},
|
|
93
|
+
|
|
94
|
+
{"paired UTF-16 surrogates",
|
|
95
|
+
"\xed\xa0\x80\xed\xb0\x80|\xed\xa0\x80\xed\xbf\xbf|\xed\xad\xbf\xed\xb0\x80|"
|
|
96
|
+
"\xed\xad\xbf\xed\xbf\xbf|\xed\xae\x80\xed\xb0\x80|\xed\xae\x80\xed\xbf\xbf|"
|
|
97
|
+
"\xed\xaf\xbf\xed\xb0\x80|\xed\xaf\xbf\xed\xbf\xbf!", 0},
|
|
98
|
+
|
|
99
|
+
{"other illegal code positions", "\xef\xbf\xbe|\xef\xbf\xbf!", 0},
|
|
100
|
+
|
|
101
|
+
{NULL, NULL, 0}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
test_case boms[] = {
|
|
105
|
+
|
|
106
|
+
/* {"title", "test!", length}, */
|
|
107
|
+
|
|
108
|
+
{"no bom (utf-8)", "Hi is \xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82!", 13},
|
|
109
|
+
{"bom (utf-8)", "\xef\xbb\xbfHi is \xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82!", 13},
|
|
110
|
+
{"bom (utf-16-le)", "\xff\xfeH\x00i\x00 \x00i\x00s\x00 \x00\x1f\x04@\x04""8\x04""2\x04""5\x04""B\x04!", 13},
|
|
111
|
+
{"bom (utf-16-be)", "\xfe\xff\x00H\x00i\x00 \x00i\x00s\x00 \x04\x1f\x04@\x04""8\x04""2\x04""5\x04""B!", 13},
|
|
112
|
+
{NULL, NULL, 0}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
char *bom_original = "Hi is \xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82";
|
|
116
|
+
|
|
117
|
+
int check_utf8_sequences(void)
|
|
118
|
+
{
|
|
119
|
+
yaml_parser_t parser;
|
|
120
|
+
int failed = 0;
|
|
121
|
+
int k;
|
|
122
|
+
printf("checking utf-8 sequences...\n");
|
|
123
|
+
for (k = 0; utf8_sequences[k].test; k++) {
|
|
124
|
+
char *title = utf8_sequences[k].title;
|
|
125
|
+
int check = utf8_sequences[k].result;
|
|
126
|
+
int result;
|
|
127
|
+
char *start = utf8_sequences[k].test;
|
|
128
|
+
char *end = start;
|
|
129
|
+
printf("\t%s:\n", title);
|
|
130
|
+
while(1) {
|
|
131
|
+
while (*end != '|' && *end != '!') end++;
|
|
132
|
+
yaml_parser_initialize(&parser);
|
|
133
|
+
yaml_parser_set_input_string(&parser, (unsigned char *)start, end-start);
|
|
134
|
+
result = yaml_parser_update_buffer(&parser, end-start);
|
|
135
|
+
if (result != check) {
|
|
136
|
+
printf("\t\t- ");
|
|
137
|
+
failed ++;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
printf("\t\t+ ");
|
|
141
|
+
}
|
|
142
|
+
if (!parser.error) {
|
|
143
|
+
printf("(no error)\n");
|
|
144
|
+
}
|
|
145
|
+
else if (parser.error == YAML_READER_ERROR) {
|
|
146
|
+
if (parser.problem_value != -1) {
|
|
147
|
+
printf("(reader error: %s: #%X at %ld)\n",
|
|
148
|
+
parser.problem, parser.problem_value, (long)parser.problem_offset);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
printf("(reader error: %s at %ld)\n",
|
|
152
|
+
parser.problem, (long)parser.problem_offset);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (*end == '!') break;
|
|
156
|
+
start = ++end;
|
|
157
|
+
yaml_parser_delete(&parser);
|
|
158
|
+
};
|
|
159
|
+
printf("\n");
|
|
160
|
+
}
|
|
161
|
+
printf("checking utf-8 sequences: %d fail(s)\n", failed);
|
|
162
|
+
return failed;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
int check_boms(void)
|
|
166
|
+
{
|
|
167
|
+
yaml_parser_t parser;
|
|
168
|
+
int failed = 0;
|
|
169
|
+
int k;
|
|
170
|
+
printf("checking boms...\n");
|
|
171
|
+
for (k = 0; boms[k].test; k++) {
|
|
172
|
+
char *title = boms[k].title;
|
|
173
|
+
int check = boms[k].result;
|
|
174
|
+
int result;
|
|
175
|
+
char *start = boms[k].test;
|
|
176
|
+
char *end = start;
|
|
177
|
+
while (*end != '!') end++;
|
|
178
|
+
printf("\t%s: ", title);
|
|
179
|
+
yaml_parser_initialize(&parser);
|
|
180
|
+
yaml_parser_set_input_string(&parser, (unsigned char *)start, end-start);
|
|
181
|
+
result = yaml_parser_update_buffer(&parser, end-start);
|
|
182
|
+
if (!result) {
|
|
183
|
+
printf("- (reader error: %s at %ld)\n", parser.problem, (long)parser.problem_offset);
|
|
184
|
+
failed++;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
if (parser.unread != check) {
|
|
188
|
+
printf("- (length=%ld while expected length=%d)\n", (long)parser.unread, check);
|
|
189
|
+
failed++;
|
|
190
|
+
}
|
|
191
|
+
else if (memcmp(parser.buffer.start, bom_original, check) != 0) {
|
|
192
|
+
printf("- (value '%s' does not equal to the original value '%s')\n", parser.buffer.start, bom_original);
|
|
193
|
+
failed++;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
printf("+\n");
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
yaml_parser_delete(&parser);
|
|
200
|
+
}
|
|
201
|
+
printf("checking boms: %d fail(s)\n", failed);
|
|
202
|
+
return failed;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
#define LONG 100000
|
|
206
|
+
|
|
207
|
+
int check_long_utf8(void)
|
|
208
|
+
{
|
|
209
|
+
yaml_parser_t parser;
|
|
210
|
+
int k = 0;
|
|
211
|
+
int j;
|
|
212
|
+
int failed = 0;
|
|
213
|
+
unsigned char ch0, ch1;
|
|
214
|
+
unsigned char *buffer = (unsigned char *)malloc(3+LONG*2);
|
|
215
|
+
assert(buffer);
|
|
216
|
+
printf("checking a long utf8 sequence...\n");
|
|
217
|
+
buffer[k++] = '\xef';
|
|
218
|
+
buffer[k++] = '\xbb';
|
|
219
|
+
buffer[k++] = '\xbf';
|
|
220
|
+
for (j = 0; j < LONG; j ++) {
|
|
221
|
+
if (j % 2) {
|
|
222
|
+
buffer[k++] = '\xd0';
|
|
223
|
+
buffer[k++] = '\x90';
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
buffer[k++] = '\xd0';
|
|
227
|
+
buffer[k++] = '\xaf';
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
yaml_parser_initialize(&parser);
|
|
231
|
+
yaml_parser_set_input_string(&parser, buffer, 3+LONG*2);
|
|
232
|
+
for (k = 0; k < LONG; k++) {
|
|
233
|
+
if (!parser.unread) {
|
|
234
|
+
if (!yaml_parser_update_buffer(&parser, 1)) {
|
|
235
|
+
printf("\treader error: %s at %ld\n", parser.problem, (long)parser.problem_offset);
|
|
236
|
+
failed = 1;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!parser.unread) {
|
|
241
|
+
printf("\tnot enough characters at %d\n", k);
|
|
242
|
+
failed = 1;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
if (k % 2) {
|
|
246
|
+
ch0 = '\xd0';
|
|
247
|
+
ch1 = '\x90';
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
ch0 = '\xd0';
|
|
251
|
+
ch1 = '\xaf';
|
|
252
|
+
}
|
|
253
|
+
if (parser.buffer.pointer[0] != ch0 || parser.buffer.pointer[1] != ch1) {
|
|
254
|
+
printf("\tincorrect UTF-8 sequence: %X %X instead of %X %X\n",
|
|
255
|
+
(int)parser.buffer.pointer[0], (int)parser.buffer.pointer[1],
|
|
256
|
+
(int)ch0, (int)ch1);
|
|
257
|
+
failed = 1;
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
parser.buffer.pointer += 2;
|
|
261
|
+
parser.unread -= 1;
|
|
262
|
+
}
|
|
263
|
+
if (!failed) {
|
|
264
|
+
if (!yaml_parser_update_buffer(&parser, 1)) {
|
|
265
|
+
printf("\treader error: %s at %ld\n", parser.problem, (long)parser.problem_offset);
|
|
266
|
+
failed = 1;
|
|
267
|
+
}
|
|
268
|
+
else if (parser.buffer.pointer[0] != '\0') {
|
|
269
|
+
printf("\texpected NUL, found %X (eof=%d, unread=%ld)\n", (int)parser.buffer.pointer[0], parser.eof, (long)parser.unread);
|
|
270
|
+
failed = 1;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
yaml_parser_delete(&parser);
|
|
274
|
+
free(buffer);
|
|
275
|
+
printf("checking a long utf8 sequence: %d fail(s)\n", failed);
|
|
276
|
+
return failed;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
int check_long_utf16(void)
|
|
280
|
+
{
|
|
281
|
+
yaml_parser_t parser;
|
|
282
|
+
int k = 0;
|
|
283
|
+
int j;
|
|
284
|
+
int failed = 0;
|
|
285
|
+
unsigned char ch0, ch1;
|
|
286
|
+
unsigned char *buffer = (unsigned char *)malloc(2+LONG*2);
|
|
287
|
+
assert(buffer);
|
|
288
|
+
printf("checking a long utf16 sequence...\n");
|
|
289
|
+
buffer[k++] = '\xff';
|
|
290
|
+
buffer[k++] = '\xfe';
|
|
291
|
+
for (j = 0; j < LONG; j ++) {
|
|
292
|
+
if (j % 2) {
|
|
293
|
+
buffer[k++] = '\x10';
|
|
294
|
+
buffer[k++] = '\x04';
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
buffer[k++] = '/';
|
|
298
|
+
buffer[k++] = '\x04';
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
yaml_parser_initialize(&parser);
|
|
302
|
+
yaml_parser_set_input_string(&parser, buffer, 2+LONG*2);
|
|
303
|
+
for (k = 0; k < LONG; k++) {
|
|
304
|
+
if (!parser.unread) {
|
|
305
|
+
if (!yaml_parser_update_buffer(&parser, 1)) {
|
|
306
|
+
printf("\treader error: %s at %ld\n", parser.problem, (long)parser.problem_offset);
|
|
307
|
+
failed = 1;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (!parser.unread) {
|
|
312
|
+
printf("\tnot enough characters at %d\n", k);
|
|
313
|
+
failed = 1;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
if (k % 2) {
|
|
317
|
+
ch0 = '\xd0';
|
|
318
|
+
ch1 = '\x90';
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
ch0 = '\xd0';
|
|
322
|
+
ch1 = '\xaf';
|
|
323
|
+
}
|
|
324
|
+
if (parser.buffer.pointer[0] != ch0 || parser.buffer.pointer[1] != ch1) {
|
|
325
|
+
printf("\tincorrect UTF-8 sequence: %X %X instead of %X %X\n",
|
|
326
|
+
(int)parser.buffer.pointer[0], (int)parser.buffer.pointer[1],
|
|
327
|
+
(int)ch0, (int)ch1);
|
|
328
|
+
failed = 1;
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
parser.buffer.pointer += 2;
|
|
332
|
+
parser.unread -= 1;
|
|
333
|
+
}
|
|
334
|
+
if (!failed) {
|
|
335
|
+
if (!yaml_parser_update_buffer(&parser, 1)) {
|
|
336
|
+
printf("\treader error: %s at %ld\n", parser.problem, (long)parser.problem_offset);
|
|
337
|
+
failed = 1;
|
|
338
|
+
}
|
|
339
|
+
else if (parser.buffer.pointer[0] != '\0') {
|
|
340
|
+
printf("\texpected NUL, found %X (eof=%d, unread=%ld)\n", (int)parser.buffer.pointer[0], parser.eof, (long)parser.unread);
|
|
341
|
+
failed = 1;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
yaml_parser_delete(&parser);
|
|
345
|
+
free(buffer);
|
|
346
|
+
printf("checking a long utf16 sequence: %d fail(s)\n", failed);
|
|
347
|
+
return failed;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
int
|
|
351
|
+
main(void)
|
|
352
|
+
{
|
|
353
|
+
return check_utf8_sequences() + check_boms() + check_long_utf8() + check_long_utf16();
|
|
354
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#include <yaml.h>
|
|
2
|
+
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
|
|
6
|
+
#ifdef NDEBUG
|
|
7
|
+
#undef NDEBUG
|
|
8
|
+
#endif
|
|
9
|
+
#include <assert.h>
|
|
10
|
+
|
|
11
|
+
int
|
|
12
|
+
main(void)
|
|
13
|
+
{
|
|
14
|
+
int major = -1;
|
|
15
|
+
int minor = -1;
|
|
16
|
+
int patch = -1;
|
|
17
|
+
char buf[64];
|
|
18
|
+
|
|
19
|
+
yaml_get_version(&major, &minor, &patch);
|
|
20
|
+
sprintf(buf, "%d.%d.%d", major, minor, patch);
|
|
21
|
+
assert(strcmp(buf, yaml_get_version_string()) == 0);
|
|
22
|
+
|
|
23
|
+
/* Print structure sizes. */
|
|
24
|
+
printf("sizeof(token) = %ld\n", (long)sizeof(yaml_token_t));
|
|
25
|
+
printf("sizeof(event) = %ld\n", (long)sizeof(yaml_event_t));
|
|
26
|
+
printf("sizeof(parser) = %ld\n", (long)sizeof(yaml_parser_t));
|
|
27
|
+
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Config file for the yaml library.
|
|
2
|
+
#
|
|
3
|
+
# It defines the following variables:
|
|
4
|
+
# yaml_LIBRARIES - libraries to link against
|
|
5
|
+
|
|
6
|
+
@PACKAGE_INIT@
|
|
7
|
+
|
|
8
|
+
set_and_check(yaml_TARGETS "@PACKAGE_CONFIG_DIR_CONFIG@/yamlTargets.cmake")
|
|
9
|
+
|
|
10
|
+
if(NOT yaml_TARGETS_IMPORTED)
|
|
11
|
+
set(yaml_TARGETS_IMPORTED 1)
|
|
12
|
+
include(${yaml_TARGETS})
|
|
13
|
+
endif()
|
|
14
|
+
|
|
15
|
+
set(yaml_LIBRARIES yaml)
|
|
16
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
require "mkmf"
|
|
2
|
+
|
|
3
|
+
apex_src = File.expand_path('apex_src', __dir__)
|
|
4
|
+
apex_incl = File.join(apex_src, 'include')
|
|
5
|
+
apex_srcdir = File.join(apex_src, 'src')
|
|
6
|
+
apex_extdir = File.join(apex_srcdir, 'extensions')
|
|
7
|
+
vendor_cmark = File.join(apex_src, 'vendor', 'cmark-gfm')
|
|
8
|
+
config_incl_dir = File.join(apex_src, 'PackageSupport', 'cmark-gfm')
|
|
9
|
+
$INCFLAGS << " -I#{apex_incl}"
|
|
10
|
+
$INCFLAGS << " -I#{config_incl_dir}"
|
|
11
|
+
|
|
12
|
+
# html_renderer.c includes internal cmark-gfm headers like "table.h" which
|
|
13
|
+
# are not installed by system cmark-gfm. When the Apex submodule has its
|
|
14
|
+
# cmark-gfm vendor populated, add that header path so those includes work,
|
|
15
|
+
# while still linking against the system library.
|
|
16
|
+
vendor_cmark_src = File.join(vendor_cmark, 'src')
|
|
17
|
+
vendor_cmark_ext = File.join(vendor_cmark, 'extensions')
|
|
18
|
+
$INCFLAGS << " -I#{vendor_cmark_src}" if Dir.exist?(vendor_cmark_src)
|
|
19
|
+
$INCFLAGS << " -I#{vendor_cmark_ext}" if Dir.exist?(vendor_cmark_ext)
|
|
20
|
+
|
|
21
|
+
# Add Apex source tree (core + extensions) to VPATH so we can refer to
|
|
22
|
+
# files by basename and let make find the sources.
|
|
23
|
+
$VPATH << File::PATH_SEPARATOR << apex_srcdir
|
|
24
|
+
$VPATH << File::PATH_SEPARATOR << apex_extdir
|
|
25
|
+
|
|
26
|
+
core_sources = Dir[File.join(apex_srcdir, '*.c')]
|
|
27
|
+
ext_sources = Dir[File.join(apex_extdir, '*.c')]
|
|
28
|
+
|
|
29
|
+
# Apex's html_renderer.c uses CMARK_NODE_* from cmark-gfm extensions (table,
|
|
30
|
+
# strikethrough, etc.). The system libcmark-gfm often does not export these;
|
|
31
|
+
# compile all vendored extension .c files into the bundle so the symbols exist.
|
|
32
|
+
cmark_ext_dir = File.join(vendor_cmark, 'extensions')
|
|
33
|
+
cmark_ext_sources = Dir[File.join(cmark_ext_dir, '*.c')]
|
|
34
|
+
if cmark_ext_sources.any?
|
|
35
|
+
$VPATH << File::PATH_SEPARATOR << cmark_ext_dir
|
|
36
|
+
cmark_ext_basenames = cmark_ext_sources.map { |f| File.basename(f) }
|
|
37
|
+
$srcs = core_sources.map { |f| File.basename(f) } +
|
|
38
|
+
ext_sources.map { |f| File.basename(f) } +
|
|
39
|
+
cmark_ext_basenames +
|
|
40
|
+
['apex_ext.c']
|
|
41
|
+
else
|
|
42
|
+
$srcs = core_sources.map { |f| File.basename(f) } +
|
|
43
|
+
ext_sources.map { |f| File.basename(f) } +
|
|
44
|
+
['apex_ext.c']
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# ---- cmark-gfm system detection ------------------------------------------
|
|
48
|
+
#
|
|
49
|
+
# We link against a system cmark-gfm installation, using the vendored
|
|
50
|
+
# headers (if present) for internal types like CMARK_NODE_TABLE.
|
|
51
|
+
#
|
|
52
|
+
# Set APEX_SHOW_CMARK_ERROR=1 to print the "cmark-gfm not found" message and
|
|
53
|
+
# exit without building (useful for previewing the user-facing error).
|
|
54
|
+
#
|
|
55
|
+
CMARK_NOT_FOUND_MSG = <<~MSG
|
|
56
|
+
-------------------------------------------------------------------------------
|
|
57
|
+
The apex gem could not find the cmark-gfm C library.
|
|
58
|
+
-------------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
This gem requires cmark-gfm to be installed before you can build the native
|
|
61
|
+
extension. Install it for your system, then run `gem install apex-ruby` again.
|
|
62
|
+
|
|
63
|
+
macOS (Homebrew):
|
|
64
|
+
brew install cmark-gfm
|
|
65
|
+
|
|
66
|
+
Other platforms:
|
|
67
|
+
Install the cmark-gfm development package for your distribution, ensure
|
|
68
|
+
pkg-config is available, then retry. See:
|
|
69
|
+
https://github.com/github/cmark-gfm
|
|
70
|
+
|
|
71
|
+
-------------------------------------------------------------------------------
|
|
72
|
+
MSG
|
|
73
|
+
|
|
74
|
+
def require_cmark_gfm!
|
|
75
|
+
if ENV['APEX_SHOW_CMARK_ERROR']
|
|
76
|
+
warn CMARK_NOT_FOUND_MSG
|
|
77
|
+
abort
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if pkg_config('cmark-gfm')
|
|
81
|
+
# pkg-config has already added the right flags (and usually rpath).
|
|
82
|
+
return true
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
have_header('cmark-gfm-core-extensions.h')
|
|
86
|
+
unless have_library('cmark-gfm')
|
|
87
|
+
abort CMARK_NOT_FOUND_MSG
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Embed rpath so the .bundle finds libcmark-gfm at load time (macOS often
|
|
91
|
+
# ignores DYLD_LIBRARY_PATH for dlopen'd dependencies).
|
|
92
|
+
cmark_lib = `brew --prefix cmark-gfm 2>/dev/null`.strip
|
|
93
|
+
cmark_lib = File.join(cmark_lib, 'lib') if !cmark_lib.empty? && Dir.exist?(File.join(cmark_lib, 'lib'))
|
|
94
|
+
if RbConfig::CONFIG['host_os'].to_s.include?('darwin') && !cmark_lib.empty?
|
|
95
|
+
$LDFLAGS << " -Wl,-rpath,#{cmark_lib}"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
require_cmark_gfm!
|
|
102
|
+
|
|
103
|
+
create_makefile('apex_ext/apex_ext')
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Apex
|
|
4
|
+
module Utils
|
|
5
|
+
# Mixin providing a simple registry of configurable extensions,
|
|
6
|
+
# modeled after +Kramdown::Utils::Configurable+.
|
|
7
|
+
#
|
|
8
|
+
# @example
|
|
9
|
+
# module Apex
|
|
10
|
+
# extend Apex::Utils::Configurable
|
|
11
|
+
#
|
|
12
|
+
# configurable :syntax_highlighter
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# Apex.add_syntax_highlighter(:rouge, ->(code, lang, opts) { ... })
|
|
16
|
+
# Apex.syntax_highlighter(:rouge) # => registered callable
|
|
17
|
+
module Configurable
|
|
18
|
+
# Declare a configurable extension point.
|
|
19
|
+
#
|
|
20
|
+
# This defines three singleton methods on the receiver:
|
|
21
|
+
#
|
|
22
|
+
# * +configurables+ – a Hash-of-Hashes registry.
|
|
23
|
+
# * +name(ext_name)+ – retrieve the registered data for +ext_name+.
|
|
24
|
+
# * +add_name(ext_name, data = nil, &block)+ – register +ext_name+.
|
|
25
|
+
#
|
|
26
|
+
# @param name [Symbol, String] the logical name of the configurable
|
|
27
|
+
# @return [void]
|
|
28
|
+
def configurable(name)
|
|
29
|
+
unless respond_to?(:configurables)
|
|
30
|
+
singleton_class.send(:define_method, :configurables) do
|
|
31
|
+
@_configurables ||= Hash.new { |h, k| h[k] = {} }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
singleton_class.send(:define_method, name) do |ext_name|
|
|
36
|
+
configurables[name][ext_name]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
singleton_class.send(:define_method, :"add_#{name}") do |ext_name, data = nil, &block|
|
|
40
|
+
configurables[name][ext_name] = data || block
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "configurable"
|
|
4
|
+
|
|
5
|
+
module Apex
|
|
6
|
+
# High-level document API for Apex Markdown.
|
|
7
|
+
#
|
|
8
|
+
# The primary entry point is {.markdown_to_html}, which mirrors the
|
|
9
|
+
# style of +Kramdown::Document.new(text, options).to_html+ but uses
|
|
10
|
+
# a single convenient class method:
|
|
11
|
+
#
|
|
12
|
+
# html = Apex::Document.markdown_to_html(text, mode: :unified)
|
|
13
|
+
#
|
|
14
|
+
# You can also use the instance-level API if you prefer object
|
|
15
|
+
# instances that you can reuse:
|
|
16
|
+
#
|
|
17
|
+
# doc = Apex::Document.new(text, mode: :gfm, enable_tables: true)
|
|
18
|
+
# html = doc.to_html
|
|
19
|
+
class Document
|
|
20
|
+
# Render Markdown to HTML using Apex.
|
|
21
|
+
#
|
|
22
|
+
# @param source [#to_s] the Markdown source text
|
|
23
|
+
# @param mode [Symbol, String] processing mode (:unified by default).
|
|
24
|
+
# Accepted values:
|
|
25
|
+
# * +:unified+
|
|
26
|
+
# * +:gfm+, +:github+
|
|
27
|
+
# * +:multimarkdown+, +:mmd+
|
|
28
|
+
# * +:commonmark+, +:cmark+
|
|
29
|
+
# * +:kramdown+
|
|
30
|
+
# @param options [Hash] additional Apex options, mapped directly to
|
|
31
|
+
# the underlying +apex_options+ struct (see C header for details).
|
|
32
|
+
# @return [String] rendered HTML
|
|
33
|
+
def self.markdown_to_html(source, mode: :unified, **options)
|
|
34
|
+
opts = { mode: mode }.merge(options)
|
|
35
|
+
Apex::Native.markdown_to_html(String(source), opts)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @return [String] the original Markdown source
|
|
39
|
+
attr_reader :source
|
|
40
|
+
|
|
41
|
+
# @return [Symbol, String] the selected Apex mode
|
|
42
|
+
attr_reader :mode
|
|
43
|
+
|
|
44
|
+
# @return [Hash] options passed on to the native Apex renderer
|
|
45
|
+
attr_reader :options
|
|
46
|
+
|
|
47
|
+
# Create a new document instance.
|
|
48
|
+
#
|
|
49
|
+
# @param source [#to_s] the Markdown source text
|
|
50
|
+
# @param mode [Symbol, String] processing mode, defaults to +:unified+
|
|
51
|
+
# @param options [Hash] additional Apex options
|
|
52
|
+
def initialize(source, mode: :unified, **options)
|
|
53
|
+
@source = String(source)
|
|
54
|
+
@mode = mode
|
|
55
|
+
@options = options
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Render this document to HTML.
|
|
59
|
+
#
|
|
60
|
+
# @return [String] rendered HTML
|
|
61
|
+
def to_html
|
|
62
|
+
self.class.markdown_to_html(@source, mode: @mode, **@options)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|