apex-ruby 1.0.29 → 1.0.31

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.
Files changed (490) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -8
  3. data/apex-ruby.gemspec +14 -3
  4. data/ext/apex_ext/apex_src/include/apex/apex.h +11 -2
  5. data/ext/apex_ext/apex_src/src/apex.c +64 -5
  6. data/ext/apex_ext/apex_src/src/ast_terminal.c +2 -4
  7. data/ext/apex_ext/apex_src/src/extensions/callouts.c +103 -63
  8. data/ext/apex_ext/apex_src/src/extensions/callouts.h +3 -2
  9. data/ext/apex_ext/apex_src/src/extensions/citations.c +15 -2
  10. data/ext/apex_ext/apex_src/src/extensions/emoji.c +73 -7
  11. data/ext/apex_ext/apex_src/src/extensions/html_markdown.c +25 -4
  12. data/ext/apex_ext/apex_src/src/extensions/html_markdown.h +4 -1
  13. data/ext/apex_ext/apex_src/src/extensions/insert.c +49 -0
  14. data/ext/apex_ext/apex_src/src/extensions/metadata.c +275 -55
  15. data/ext/apex_ext/apex_src/src/extensions/metadata.h +9 -0
  16. data/ext/apex_ext/apex_src/src/extensions/relaxed_tables.c +172 -254
  17. data/ext/apex_ext/apex_src/src/extensions/table_html_postprocess.c +36 -127
  18. data/ext/apex_ext/apex_src/src/html_renderer.c +99 -157
  19. data/ext/apex_ext/extconf.rb +31 -79
  20. data/lib/apex/version.rb +1 -1
  21. metadata +1 -470
  22. data/ext/apex_ext/apex_src/AGENTS.md +0 -41
  23. data/ext/apex_ext/apex_src/BENCHMARK.md +0 -32
  24. data/ext/apex_ext/apex_src/BENCHMARK_COMPARISON.md +0 -67
  25. data/ext/apex_ext/apex_src/CHANGELOG.md +0 -3373
  26. data/ext/apex_ext/apex_src/CMakeLists.txt +0 -481
  27. data/ext/apex_ext/apex_src/Dockerfile.linux-build +0 -15
  28. data/ext/apex_ext/apex_src/Formula/apex.rb +0 -43
  29. data/ext/apex_ext/apex_src/Info.plist.in +0 -27
  30. data/ext/apex_ext/apex_src/Package.swift +0 -192
  31. data/ext/apex_ext/apex_src/PackageSupport/README.md +0 -17
  32. data/ext/apex_ext/apex_src/PackageSupport/cmark-gfm/cmark_gfm_spm_stub.c +0 -4
  33. data/ext/apex_ext/apex_src/README.md +0 -536
  34. data/ext/apex_ext/apex_src/ROADMAP.md +0 -5
  35. data/ext/apex_ext/apex_src/VERSION +0 -1
  36. data/ext/apex_ext/apex_src/apex-debug.log +0 -4
  37. data/ext/apex_ext/apex_src/apex-header-2-rb@2x.webp +0 -0
  38. data/ext/apex_ext/apex_src/apex-plugins.json.example +0 -20
  39. data/ext/apex_ext/apex_src/apex.code-workspace +0 -38
  40. data/ext/apex_ext/apex_src/apex.pc.in +0 -11
  41. data/ext/apex_ext/apex_src/apex.taskpaper +0 -12
  42. data/ext/apex_ext/apex_src/apex_deflist_debug.log +0 -25
  43. data/ext/apex_ext/apex_src/buildnotes.md +0 -1435
  44. data/ext/apex_ext/apex_src/cli/main.c +0 -4588
  45. data/ext/apex_ext/apex_src/debug.log +0 -7
  46. data/ext/apex_ext/apex_src/debug_test.sh +0 -22
  47. data/ext/apex_ext/apex_src/docs/API_REFERENCE.md +0 -451
  48. data/ext/apex_ext/apex_src/docs/ARCHITECTURE.md +0 -166
  49. data/ext/apex_ext/apex_src/docs/CITATIONS_EXAMPLES.md +0 -274
  50. data/ext/apex_ext/apex_src/docs/CITATIONS_IMPLEMENTATION_PLAN.md +0 -749
  51. data/ext/apex_ext/apex_src/docs/CITATIONS_PLAN.md +0 -744
  52. data/ext/apex_ext/apex_src/docs/CMARK_INTEGRATION.md +0 -220
  53. data/ext/apex_ext/apex_src/docs/CRITICMARKUP.md +0 -501
  54. data/ext/apex_ext/apex_src/docs/DEBUGGING.md +0 -73
  55. data/ext/apex_ext/apex_src/docs/FINAL_STATUS.md +0 -391
  56. data/ext/apex_ext/apex_src/docs/FINAL_STATUS_UPDATE.md +0 -237
  57. data/ext/apex_ext/apex_src/docs/IAL_FEATURES.md +0 -210
  58. data/ext/apex_ext/apex_src/docs/IAL_STATUS.md +0 -344
  59. data/ext/apex_ext/apex_src/docs/INDEX_IMPLEMENTATION_ANALYSIS.md +0 -382
  60. data/ext/apex_ext/apex_src/docs/INTEGRATION_EXAMPLE.m +0 -144
  61. data/ext/apex_ext/apex_src/docs/LIMITATIONS_RESOLVED.md +0 -278
  62. data/ext/apex_ext/apex_src/docs/OUTPUT_MODES.md +0 -321
  63. data/ext/apex_ext/apex_src/docs/PROGRESS.md +0 -167
  64. data/ext/apex_ext/apex_src/docs/STANDALONE_FEATURE.md +0 -174
  65. data/ext/apex_ext/apex_src/docs/TABLE_SPANS_STATUS.md +0 -243
  66. data/ext/apex_ext/apex_src/docs/TEST_COVERAGE.md +0 -316
  67. data/ext/apex_ext/apex_src/docs/USER_GUIDE.md +0 -803
  68. data/ext/apex_ext/apex_src/docs/WIKI_LINKS_ISSUE.md +0 -91
  69. data/ext/apex_ext/apex_src/docs/index.md +0 -459
  70. data/ext/apex_ext/apex_src/docs/plans/2025-02-27-man-page-output-implementation.md +0 -351
  71. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-12-toc-output-format.md +0 -745
  72. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-18-bear-image-attributes.md +0 -829
  73. data/ext/apex_ext/apex_src/docs/superpowers/plans/2026-07-19-apex-node-npm.md +0 -1148
  74. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-12-toc-output-format-design.md +0 -161
  75. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-18-bear-image-attributes-design.md +0 -184
  76. data/ext/apex_ext/apex_src/docs/superpowers/specs/2026-07-19-apex-node-npm-design.md +0 -211
  77. data/ext/apex_ext/apex_src/documentation/README.md +0 -160
  78. data/ext/apex_ext/apex_src/documentation/app-settings-table.md +0 -67
  79. data/ext/apex_ext/apex_src/documentation/app-transformed/Citations.md +0 -340
  80. data/ext/apex_ext/apex_src/documentation/app-transformed/Credits.md +0 -11
  81. data/ext/apex_ext/apex_src/documentation/app-transformed/Header-IDs.md +0 -234
  82. data/ext/apex_ext/apex_src/documentation/app-transformed/Inline-Attribute-Lists.md +0 -516
  83. data/ext/apex_ext/apex_src/documentation/app-transformed/Metadata-Transforms.md +0 -461
  84. data/ext/apex_ext/apex_src/documentation/app-transformed/Modes.md +0 -193
  85. data/ext/apex_ext/apex_src/documentation/app-transformed/Multi-File-Documents.md +0 -201
  86. data/ext/apex_ext/apex_src/documentation/app-transformed/Plugins.md +0 -678
  87. data/ext/apex_ext/apex_src/documentation/app-transformed/Syntax.md +0 -1367
  88. data/ext/apex_ext/apex_src/documentation/docsets/Apex Command Line Options.cheatsheet.txt +0 -371
  89. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Info.plist +0 -24
  90. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/C-API.html +0 -2211
  91. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Callouts.html +0 -1194
  92. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Citations.html +0 -1620
  93. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Command-Line-Options.html +0 -6024
  94. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Configuration.html +0 -1877
  95. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Credits.html +0 -1040
  96. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Examples.html +0 -1402
  97. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Filters.html +0 -1656
  98. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Generating-Man-Pages.html +0 -1226
  99. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Getting-Started.html +0 -1148
  100. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Header-IDs.html +0 -1478
  101. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Home.html +0 -1225
  102. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Indices.html +0 -2327
  103. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Inline-Attribute-Lists.html +0 -2041
  104. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Installation.html +0 -1314
  105. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Limitations-and-Roadmap.html +0 -1868
  106. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Metadata-Transforms.html +0 -1731
  107. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Modes.html +0 -2242
  108. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-File-Documents.html +0 -1533
  109. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Multi-Format-Images.html +0 -1362
  110. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Pandoc-Integration.html +0 -1338
  111. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Plugins.html +0 -3188
  112. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Quarto-Mode.html +0 -1405
  113. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Rendering-Markdown-In-Terminal.html +0 -1902
  114. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Syntax.html +0 -4222
  115. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Tables.html +0 -1781
  116. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Troubleshooting.html +0 -1629
  117. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Usage.html +0 -1394
  118. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Using-Apex-with-Jekyll.html +0 -1132
  119. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Writing-Tests.html +0 -1754
  120. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/Documents/Xcode-Integration.html +0 -2562
  121. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/docSet.dsidx +0 -0
  122. data/ext/apex_ext/apex_src/documentation/docsets/Apex.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  123. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Info.plist +0 -22
  124. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans.woff +0 -0
  125. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold.woff +0 -0
  126. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Bold_Italic.woff +0 -0
  127. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold.woff +0 -0
  128. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Extrabold_Italic.woff +0 -0
  129. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Italic.woff +0 -0
  130. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold.woff +0 -0
  131. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/cheatset_resources/Open_Sans_Semibold_Italic.woff +0 -0
  132. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/index.html +0 -914
  133. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/Documents/style.css +0 -399
  134. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/docSet.dsidx +0 -0
  135. data/ext/apex_ext/apex_src/documentation/docsets/ApexCLI.docset/Contents/Resources/optimizedIndex.dsidx +0 -0
  136. data/ext/apex_ext/apex_src/documentation/generate_app_docs.rb +0 -772
  137. data/ext/apex_ext/apex_src/documentation/generate_app_docs_ai.rb +0 -678
  138. data/ext/apex_ext/apex_src/documentation/generate_docset.rb +0 -873
  139. data/ext/apex_ext/apex_src/documentation/generate_single_html.rb +0 -733
  140. data/ext/apex_ext/apex_src/documentation/html/apex-app-docs.html +0 -8746
  141. data/ext/apex_ext/apex_src/documentation/html/apex-docs.html +0 -17073
  142. data/ext/apex_ext/apex_src/documentation/shared_scripts.js +0 -64
  143. data/ext/apex_ext/apex_src/documentation/shared_styles.css +0 -651
  144. data/ext/apex_ext/apex_src/documentation/transform_for_app.example.md +0 -260
  145. data/ext/apex_ext/apex_src/documentation/transform_for_app.md +0 -55
  146. data/ext/apex_ext/apex_src/escaping-repro.md +0 -103
  147. data/ext/apex_ext/apex_src/examples/bracketed_spans_demo.md +0 -119
  148. data/ext/apex_ext/apex_src/examples/emoji_span_plugin.yml +0 -11
  149. data/ext/apex_ext/apex_src/examples/example.html +0 -53
  150. data/ext/apex_ext/apex_src/examples/example.md +0 -85
  151. data/ext/apex_ext/apex_src/examples/fenced_divs_demo.md +0 -158
  152. data/ext/apex_ext/apex_src/examples/kbd.md +0 -8
  153. data/ext/apex_ext/apex_src/examples/kbd_plugin.rb +0 -250
  154. data/ext/apex_ext/apex_src/examples/kbd_plugin.yml +0 -9
  155. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/Info.plist +0 -8
  156. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/QuickLook/Preview.png +0 -0
  157. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown to RTF.workflow/Contents/document.wflow +0 -547
  158. data/ext/apex_ext/apex_src/examples/quick-actions/Markdown-to-RTF.workflow.zip +0 -0
  159. data/ext/apex_ext/apex_src/examples/quick-actions/README.md +0 -33
  160. data/ext/apex_ext/apex_src/ial.html +0 -24
  161. data/ext/apex_ext/apex_src/icon/apexicon-outline-black.png +0 -0
  162. data/ext/apex_ext/apex_src/icon/apexicon-outline-black@2x.png +0 -0
  163. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark.png +0 -0
  164. data/ext/apex_ext/apex_src/icon/apexicon-outline-mark@2x.png +0 -0
  165. data/ext/apex_ext/apex_src/icon/apexicon-outline-white.png +0 -0
  166. data/ext/apex_ext/apex_src/icon/apexicon-outline-white@2x.png +0 -0
  167. data/ext/apex_ext/apex_src/icon/apexicon.png +0 -0
  168. data/ext/apex_ext/apex_src/icon/apexicon@2x.png +0 -0
  169. data/ext/apex_ext/apex_src/man/apex-config.5 +0 -455
  170. data/ext/apex_ext/apex_src/man/apex-config.5.md +0 -262
  171. data/ext/apex_ext/apex_src/man/apex-plugins.7 +0 -541
  172. data/ext/apex_ext/apex_src/man/apex-plugins.7.md +0 -365
  173. data/ext/apex_ext/apex_src/man/apex.1 +0 -583
  174. data/ext/apex_ext/apex_src/man/apex.1.html +0 -703
  175. data/ext/apex_ext/apex_src/man/apex.1.md +0 -803
  176. data/ext/apex_ext/apex_src/man/apex.1.new +0 -338
  177. data/ext/apex_ext/apex_src/objc/Apex.swift +0 -316
  178. data/ext/apex_ext/apex_src/objc/ApexPlugins.swift +0 -79
  179. data/ext/apex_ext/apex_src/objc/NSString+Apex.h +0 -207
  180. data/ext/apex_ext/apex_src/objc/NSString+Apex.m +0 -584
  181. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.h +0 -76
  182. data/ext/apex_ext/apex_src/objc/NSString+ApexPlugins.m +0 -169
  183. data/ext/apex_ext/apex_src/output.html +0 -87
  184. data/ext/apex_ext/apex_src/pages/index.md +0 -459
  185. data/ext/apex_ext/apex_src/plans/quarto-mode.md +0 -442
  186. data/ext/apex_ext/apex_src/src/_README.md +0 -413
  187. data/ext/apex_ext/apex_src/src/extensions/github-emoji.txt +0 -869
  188. data/ext/apex_ext/apex_src/test-linux-build.sh +0 -20
  189. data/ext/apex_ext/apex_src/test.html +0 -103
  190. data/ext/apex_ext/apex_src/test_coverage.sh +0 -121
  191. data/ext/apex_ext/apex_src/test_ial_fenced.md +0 -6
  192. data/ext/apex_ext/apex_src/test_math_norm.py +0 -79
  193. data/ext/apex_ext/apex_src/test_pandoc_output.html +0 -48
  194. data/ext/apex_ext/apex_src/test_spm.sh +0 -107
  195. data/ext/apex_ext/apex_src/tests/ApexSPMTest/main.swift +0 -50
  196. data/ext/apex_ext/apex_src/tests/BENCHMARK_RESULTS.md +0 -229
  197. data/ext/apex_ext/apex_src/tests/CMakeLists.txt +0 -25
  198. data/ext/apex_ext/apex_src/tests/README.md +0 -152
  199. data/ext/apex_ext/apex_src/tests/benchmark.sh +0 -113
  200. data/ext/apex_ext/apex_src/tests/benchmark_comparison.sh +0 -166
  201. data/ext/apex_ext/apex_src/tests/compare_header_ids.sh +0 -31
  202. data/ext/apex_ext/apex_src/tests/fixtures/basic/headers.md +0 -25
  203. data/ext/apex_ext/apex_src/tests/fixtures/basic/list-interruption.md +0 -24
  204. data/ext/apex_ext/apex_src/tests/fixtures/basic/misc_markup.md +0 -33
  205. data/ext/apex_ext/apex_src/tests/fixtures/basic/test_basic.md +0 -26
  206. data/ext/apex_ext/apex_src/tests/fixtures/code/code-blocks.md +0 -260
  207. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/SUMMARY.md +0 -6
  208. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/chapter1.md +0 -7
  209. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/index.txt +0 -9
  210. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/intro.md +0 -5
  211. data/ext/apex_ext/apex_src/tests/fixtures/combine_summary/section1_1.md +0 -5
  212. data/ext/apex_ext/apex_src/tests/fixtures/comprehensive_test.md +0 -652
  213. data/ext/apex_ext/apex_src/tests/fixtures/debug_ref_image_ial.md +0 -3
  214. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial.md +0 -11
  215. data/ext/apex_ext/apex_src/tests/fixtures/demos/ial_demo.md +0 -177
  216. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji-autocorrect.md +0 -94
  217. data/ext/apex_ext/apex_src/tests/fixtures/extensions/emoji_test.md +0 -3
  218. data/ext/apex_ext/apex_src/tests/fixtures/extensions/kbd_test.md +0 -3
  219. data/ext/apex_ext/apex_src/tests/fixtures/filters/filter_output_with_rawblock.json +0 -1
  220. data/ext/apex_ext/apex_src/tests/fixtures/filters/unwrap.md +0 -7
  221. data/ext/apex_ext/apex_src/tests/fixtures/ial/bracketed_spans_test.md +0 -74
  222. data/ext/apex_ext/apex_src/tests/fixtures/images/auto-wildcard.md +0 -8
  223. data/ext/apex_ext/apex_src/tests/fixtures/images/bear_image_attributes.md +0 -10
  224. data/ext/apex_ext/apex_src/tests/fixtures/images/image_and_encoding_test.md +0 -27
  225. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.avif +0 -0
  226. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.jpg +0 -0
  227. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu.webp +0 -0
  228. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.avif +0 -0
  229. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.jpg +0 -0
  230. data/ext/apex_ext/apex_src/tests/fixtures/images/img/app-pass-1-profile-menu@2x.webp +0 -0
  231. data/ext/apex_ext/apex_src/tests/fixtures/images/media_formats_test.md +0 -63
  232. data/ext/apex_ext/apex_src/tests/fixtures/images/multimarkdown_image_attributes_test.md +0 -60
  233. data/ext/apex_ext/apex_src/tests/fixtures/images/pandoc_ial_image_test.md +0 -27
  234. data/ext/apex_ext/apex_src/tests/fixtures/images/width_height_conversion_test.md +0 -94
  235. data/ext/apex_ext/apex_src/tests/fixtures/img-in-div.md +0 -16
  236. data/ext/apex_ext/apex_src/tests/fixtures/includes/code.py +0 -4
  237. data/ext/apex_ext/apex_src/tests/fixtures/includes/data-semi.csv +0 -3
  238. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.csv +0 -5
  239. data/ext/apex_ext/apex_src/tests/fixtures/includes/data.tsv +0 -5
  240. data/ext/apex_ext/apex_src/tests/fixtures/includes/image.png +0 -2
  241. data/ext/apex_ext/apex_src/tests/fixtures/includes/metadata_options.yml +0 -11
  242. data/ext/apex_ext/apex_src/tests/fixtures/includes/nested.md +0 -8
  243. data/ext/apex_ext/apex_src/tests/fixtures/includes/raw.html +0 -4
  244. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.md +0 -19
  245. data/ext/apex_ext/apex_src/tests/fixtures/includes/sections.txt +0 -11
  246. data/ext/apex_ext/apex_src/tests/fixtures/includes/simple.md +0 -7
  247. data/ext/apex_ext/apex_src/tests/fixtures/includes/test_image.png +0 -0
  248. data/ext/apex_ext/apex_src/tests/fixtures/includes/with space.txt +0 -1
  249. data/ext/apex_ext/apex_src/tests/fixtures/large_doc.md +0 -1094
  250. data/ext/apex_ext/apex_src/tests/fixtures/metadata/mmd-metadata.md +0 -5
  251. data/ext/apex_ext/apex_src/tests/fixtures/metadata/pandoc-meta.md +0 -4
  252. data/ext/apex_ext/apex_src/tests/fixtures/metadata/yaml-frontmatter.md +0 -6
  253. data/ext/apex_ext/apex_src/tests/fixtures/metadata_options.yml +0 -11
  254. data/ext/apex_ext/apex_src/tests/fixtures/minimal_pb.md +0 -2
  255. data/ext/apex_ext/apex_src/tests/fixtures/obsidian-callouts.md +0 -46
  256. data/ext/apex_ext/apex_src/tests/fixtures/output/gfm_header_id_test.md +0 -96
  257. data/ext/apex_ext/apex_src/tests/fixtures/output/test_citations.md +0 -43
  258. data/ext/apex_ext/apex_src/tests/fixtures/output/test_def_list_links.md +0 -12
  259. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_mmark.md +0 -53
  260. data/ext/apex_ext/apex_src/tests/fixtures/output/test_index_textindex.md +0 -37
  261. data/ext/apex_ext/apex_src/tests/fixtures/pagebreak_html_repro.md +0 -5
  262. data/ext/apex_ext/apex_src/tests/fixtures/python-callouts.md +0 -47
  263. data/ext/apex_ext/apex_src/tests/fixtures/quarto/callouts.md +0 -3
  264. data/ext/apex_ext/apex_src/tests/fixtures/quarto/code-attrs.md +0 -3
  265. data/ext/apex_ext/apex_src/tests/fixtures/quarto/diagrams.md +0 -8
  266. data/ext/apex_ext/apex_src/tests/fixtures/quarto/lists.md +0 -19
  267. data/ext/apex_ext/apex_src/tests/fixtures/quarto/raw-content.md +0 -5
  268. data/ext/apex_ext/apex_src/tests/fixtures/quarto/shortcodes.md +0 -7
  269. data/ext/apex_ext/apex_src/tests/fixtures/quarto/smoke.md +0 -81
  270. data/ext/apex_ext/apex_src/tests/fixtures/quarto/spans.md +0 -5
  271. data/ext/apex_ext/apex_src/tests/fixtures/quarto-callouts.md +0 -47
  272. data/ext/apex_ext/apex_src/tests/fixtures/speed.md +0 -192
  273. data/ext/apex_ext/apex_src/tests/fixtures/tables/advanced_tables_test.md +0 -93
  274. data/ext/apex_ext/apex_src/tests/fixtures/tables/grid-tables.md +0 -37
  275. data/ext/apex_ext/apex_src/tests/fixtures/tables/inline_tables_test.md +0 -41
  276. data/ext/apex_ext/apex_src/tests/fixtures/tables/relaxed-table.md +0 -12
  277. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_cr_line_endings.md +0 -15
  278. data/ext/apex_ext/apex_src/tests/fixtures/tables/table_no_trailing_newline.md +0 -15
  279. data/ext/apex_ext/apex_src/tests/generate_gfm_ids.sh +0 -105
  280. data/ext/apex_ext/apex_src/tests/generate_ial_demo.sh +0 -143
  281. data/ext/apex_ext/apex_src/tests/gfm_id_comparison_summary.md +0 -96
  282. data/ext/apex_ext/apex_src/tests/gh_api_test.md +0 -6
  283. data/ext/apex_ext/apex_src/tests/ial_demo.html +0 -186
  284. data/ext/apex_ext/apex_src/tests/include_code.py +0 -19
  285. data/ext/apex_ext/apex_src/tests/include_snippet.md +0 -15
  286. data/ext/apex_ext/apex_src/tests/metadata_cli_test.sh +0 -119
  287. data/ext/apex_ext/apex_src/tests/multi_file_cli_test.sh +0 -64
  288. data/ext/apex_ext/apex_src/tests/paginate_cli_test.sh +0 -80
  289. data/ext/apex_ext/apex_src/tests/sample_data.csv +0 -7
  290. data/ext/apex_ext/apex_src/tests/table_escaped_ltlt.md +0 -4
  291. data/ext/apex_ext/apex_src/tests/terminal_width_test.sh +0 -29
  292. data/ext/apex_ext/apex_src/tests/test-swift-package.sh +0 -14
  293. data/ext/apex_ext/apex_src/tests/test_basic.c +0 -74
  294. data/ext/apex_ext/apex_src/tests/test_bear_image_attrs.c +0 -301
  295. data/ext/apex_ext/apex_src/tests/test_cmark_callback.c +0 -189
  296. data/ext/apex_ext/apex_src/tests/test_concordance.tsv +0 -4
  297. data/ext/apex_ext/apex_src/tests/test_custom_plugins.c +0 -78
  298. data/ext/apex_ext/apex_src/tests/test_escaping_repro.c +0 -82
  299. data/ext/apex_ext/apex_src/tests/test_extensions.c +0 -3337
  300. data/ext/apex_ext/apex_src/tests/test_helpers.c +0 -183
  301. data/ext/apex_ext/apex_src/tests/test_helpers.h +0 -91
  302. data/ext/apex_ext/apex_src/tests/test_ial.c +0 -289
  303. data/ext/apex_ext/apex_src/tests/test_links.c +0 -418
  304. data/ext/apex_ext/apex_src/tests/test_marked_integration.c +0 -290
  305. data/ext/apex_ext/apex_src/tests/test_metadata.c +0 -1147
  306. data/ext/apex_ext/apex_src/tests/test_output.c +0 -2056
  307. data/ext/apex_ext/apex_src/tests/test_plugins.c +0 -219
  308. data/ext/apex_ext/apex_src/tests/test_refs.bib +0 -31
  309. data/ext/apex_ext/apex_src/tests/test_runner.c +0 -268
  310. data/ext/apex_ext/apex_src/tests/test_syntax_highlight.c +0 -198
  311. data/ext/apex_ext/apex_src/tests/test_tables.c +0 -1298
  312. data/ext/apex_ext/apex_src/tests/update_benchmarks.sh +0 -9
  313. data/ext/apex_ext/apex_src/tests/yaml_test.md +0 -13
  314. data/ext/apex_ext/apex_src/tests.rb +0 -39
  315. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CMakeLists.txt +0 -48
  316. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.c +0 -14
  317. data/ext/apex_ext/apex_src/vendor/cmark-gfm/CheckFileOffsetBits.cmake +0 -43
  318. data/ext/apex_ext/apex_src/vendor/cmark-gfm/FindAsan.cmake +0 -74
  319. data/ext/apex_ext/apex_src/vendor/cmark-gfm/Makefile.nmake +0 -38
  320. data/ext/apex_ext/apex_src/vendor/cmark-gfm/README.md +0 -206
  321. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/CMakeLists.txt +0 -30
  322. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.cpp +0 -15
  323. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/cplusplus.h +0 -16
  324. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.c +0 -111
  325. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/harness.h +0 -35
  326. data/ext/apex_ext/apex_src/vendor/cmark-gfm/api_test/main.c +0 -1169
  327. data/ext/apex_ext/apex_src/vendor/cmark-gfm/appveyor.yml +0 -21
  328. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-flat.md +0 -16
  329. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-bq-nested.md +0 -13
  330. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-code.md +0 -11
  331. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-fences.md +0 -14
  332. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-heading.md +0 -9
  333. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-hr.md +0 -10
  334. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-html.md +0 -32
  335. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-lheading.md +0 -8
  336. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-flat.md +0 -67
  337. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-list-nested.md +0 -36
  338. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-flat.md +0 -15
  339. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/block-ref-nested.md +0 -17
  340. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-autolink.md +0 -14
  341. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-backticks.md +0 -3
  342. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-flat.md +0 -5
  343. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-nested.md +0 -5
  344. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-em-worst.md +0 -5
  345. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-entity.md +0 -11
  346. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-escape.md +0 -15
  347. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-html.md +0 -44
  348. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-flat.md +0 -23
  349. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-links-nested.md +0 -13
  350. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/inline-newlines.md +0 -24
  351. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/lorem1.md +0 -13
  352. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/samples/rawtabs.md +0 -18
  353. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/statistics.py +0 -595
  354. data/ext/apex_ext/apex_src/vendor/cmark-gfm/bench/stats.py +0 -19
  355. data/ext/apex_ext/apex_src/vendor/cmark-gfm/benchmarks.md +0 -33
  356. data/ext/apex_ext/apex_src/vendor/cmark-gfm/changelog.txt +0 -1245
  357. data/ext/apex_ext/apex_src/vendor/cmark-gfm/data/CaseFolding.txt +0 -1495
  358. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/CMakeLists.txt +0 -119
  359. data/ext/apex_ext/apex_src/vendor/cmark-gfm/extensions/ext_scanners.re +0 -92
  360. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/CMakeLists.txt +0 -22
  361. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/README.md +0 -12
  362. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic.c +0 -91
  363. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzz_quadratic_brackets.c +0 -110
  364. data/ext/apex_ext/apex_src/vendor/cmark-gfm/fuzz/fuzzloop.sh +0 -28
  365. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/CMakeLists.txt +0 -10
  366. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/make_man_page.py +0 -133
  367. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man1/cmark-gfm.1 +0 -78
  368. data/ext/apex_ext/apex_src/vendor/cmark-gfm/man/man3/cmark-gfm.3 +0 -1041
  369. data/ext/apex_ext/apex_src/vendor/cmark-gfm/nmake.bat +0 -1
  370. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/CMakeLists.txt +0 -230
  371. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/cmark-gfm_version.h.in +0 -7
  372. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h +0 -38
  373. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/config.h.in +0 -76
  374. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/libcmark-gfm.pc.in +0 -10
  375. data/ext/apex_ext/apex_src/vendor/cmark-gfm/src/scanners.re +0 -365
  376. data/ext/apex_ext/apex_src/vendor/cmark-gfm/suppressions +0 -10
  377. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/CMakeLists.txt +0 -114
  378. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/cmark.cpython-314.pyc +0 -0
  379. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/__pycache__/normalize.cpython-314.pyc +0 -0
  380. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/afl_test_cases/test.md +0 -49
  381. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark-fuzz.c +0 -58
  382. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/cmark.py +0 -105
  383. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/entity_tests.py +0 -67
  384. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-full-info-string.txt +0 -0
  385. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions-table-prefer-style-attributes.txt +0 -38
  386. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/extensions.txt +0 -989
  387. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/fuzzing_dictionary +0 -67
  388. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/normalize.py +0 -194
  389. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/pathological_tests.py +0 -160
  390. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/regression.txt +0 -375
  391. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/roundtrip_tests.py +0 -50
  392. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/run-cmark-fuzz +0 -4
  393. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/smart_punct.txt +0 -177
  394. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec.txt +0 -10212
  395. data/ext/apex_ext/apex_src/vendor/cmark-gfm/test/spec_tests.py +0 -152
  396. data/ext/apex_ext/apex_src/vendor/cmark-gfm/toolchain-mingw32.cmake +0 -17
  397. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/Dockerfile +0 -41
  398. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/appveyor-build.bat +0 -13
  399. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/make_entities_inc.py +0 -32
  400. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/mkcasefold.pl +0 -22
  401. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md.xsl +0 -319
  402. data/ext/apex_ext/apex_src/vendor/cmark-gfm/tools/xml2md_gfm.xsl +0 -80
  403. data/ext/apex_ext/apex_src/vendor/cmark-gfm/why-cmark-and-not-x.md +0 -104
  404. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.js +0 -6
  405. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.py +0 -37
  406. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rb +0 -15
  407. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper.rkt +0 -208
  408. data/ext/apex_ext/apex_src/vendor/cmark-gfm/wrappers/wrapper_ext.py +0 -109
  409. data/ext/apex_ext/apex_src/vendor/libyaml/CMakeLists.txt +0 -160
  410. data/ext/apex_ext/apex_src/vendor/libyaml/Changes +0 -372
  411. data/ext/apex_ext/apex_src/vendor/libyaml/License +0 -20
  412. data/ext/apex_ext/apex_src/vendor/libyaml/Makefile.am +0 -51
  413. data/ext/apex_ext/apex_src/vendor/libyaml/ReadMe.md +0 -46
  414. data/ext/apex_ext/apex_src/vendor/libyaml/announcement.msg +0 -89
  415. data/ext/apex_ext/apex_src/vendor/libyaml/bootstrap +0 -3
  416. data/ext/apex_ext/apex_src/vendor/libyaml/cmake/config.h.in +0 -4
  417. data/ext/apex_ext/apex_src/vendor/libyaml/configure.ac +0 -73
  418. data/ext/apex_ext/apex_src/vendor/libyaml/doc/doxygen.cfg +0 -222
  419. data/ext/apex_ext/apex_src/vendor/libyaml/docker/README.mkd +0 -17
  420. data/ext/apex_ext/apex_src/vendor/libyaml/docker/alpine-3.7 +0 -26
  421. data/ext/apex_ext/apex_src/vendor/libyaml/docker/fedora-25 +0 -26
  422. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-14.04 +0 -29
  423. data/ext/apex_ext/apex_src/vendor/libyaml/docker/ubuntu-16.04 +0 -24
  424. data/ext/apex_ext/apex_src/vendor/libyaml/examples/anchors.yaml +0 -10
  425. data/ext/apex_ext/apex_src/vendor/libyaml/examples/array.yaml +0 -2
  426. data/ext/apex_ext/apex_src/vendor/libyaml/examples/global-tag.yaml +0 -14
  427. data/ext/apex_ext/apex_src/vendor/libyaml/examples/json.yaml +0 -1
  428. data/ext/apex_ext/apex_src/vendor/libyaml/examples/mapping.yaml +0 -2
  429. data/ext/apex_ext/apex_src/vendor/libyaml/examples/numbers.yaml +0 -1
  430. data/ext/apex_ext/apex_src/vendor/libyaml/examples/strings.yaml +0 -7
  431. data/ext/apex_ext/apex_src/vendor/libyaml/examples/tags.yaml +0 -7
  432. data/ext/apex_ext/apex_src/vendor/libyaml/examples/yaml-version.yaml +0 -3
  433. data/ext/apex_ext/apex_src/vendor/libyaml/include/Makefile.am +0 -17
  434. data/ext/apex_ext/apex_src/vendor/libyaml/include/yaml.h +0 -1999
  435. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/ReadMe.md +0 -77
  436. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/Dockerfile +0 -32
  437. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/output/ReadMe +0 -1
  438. data/ext/apex_ext/apex_src/vendor/libyaml/pkg/docker/scripts/libyaml-dist.sh +0 -23
  439. data/ext/apex_ext/apex_src/vendor/libyaml/regression-inputs/clusterfuzz-testcase-minimized-5607885063061504.yml +0 -1
  440. data/ext/apex_ext/apex_src/vendor/libyaml/src/Makefile.am +0 -4
  441. data/ext/apex_ext/apex_src/vendor/libyaml/src/api.c +0 -1393
  442. data/ext/apex_ext/apex_src/vendor/libyaml/src/dumper.c +0 -394
  443. data/ext/apex_ext/apex_src/vendor/libyaml/src/emitter.c +0 -2358
  444. data/ext/apex_ext/apex_src/vendor/libyaml/src/loader.c +0 -544
  445. data/ext/apex_ext/apex_src/vendor/libyaml/src/parser.c +0 -1416
  446. data/ext/apex_ext/apex_src/vendor/libyaml/src/reader.c +0 -469
  447. data/ext/apex_ext/apex_src/vendor/libyaml/src/scanner.c +0 -3598
  448. data/ext/apex_ext/apex_src/vendor/libyaml/src/writer.c +0 -141
  449. data/ext/apex_ext/apex_src/vendor/libyaml/src/yaml_private.h +0 -684
  450. data/ext/apex_ext/apex_src/vendor/libyaml/tests/CMakeLists.txt +0 -27
  451. data/ext/apex_ext/apex_src/vendor/libyaml/tests/Makefile.am +0 -9
  452. data/ext/apex_ext/apex_src/vendor/libyaml/tests/ReadMe.md +0 -63
  453. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor-alt.c +0 -800
  454. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-deconstructor.c +0 -1127
  455. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter-alt.c +0 -217
  456. data/ext/apex_ext/apex_src/vendor/libyaml/tests/example-reformatter.c +0 -202
  457. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-all-tests.sh +0 -29
  458. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-dumper.c +0 -314
  459. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter-test-suite.c +0 -290
  460. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-emitter.c +0 -327
  461. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-loader.c +0 -63
  462. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser-test-suite.c +0 -196
  463. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-parser.c +0 -88
  464. data/ext/apex_ext/apex_src/vendor/libyaml/tests/run-scanner.c +0 -63
  465. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-reader.c +0 -354
  466. data/ext/apex_ext/apex_src/vendor/libyaml/tests/test-version.c +0 -29
  467. data/ext/apex_ext/apex_src/vendor/libyaml/yaml-0.1.pc.in +0 -10
  468. data/ext/apex_ext/apex_src/vendor/libyaml/yamlConfig.cmake.in +0 -16
  469. data/ext/apex_ext/apex_src/xcode_build/CMakeScripts/ReRunCMake.make +0 -74
  470. data/ext/apex_ext/apex_src/xcode_build/CTestTestfile.cmake +0 -22
  471. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Apex +0 -0
  472. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/Resources/Info.plist +0 -44
  473. data/ext/apex_ext/apex_src/xcode_build/Debug/Apex.framework/Versions/A/_CodeSignature/CodeResources +0 -128
  474. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.pbxproj +0 -5118
  475. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
  476. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  477. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/project.xcworkspace/xcuserdata/ttscoff.xcuserdatad/WorkspaceSettings.xcsettings +0 -8
  478. data/ext/apex_ext/apex_src/xcode_build/apex.xcodeproj/xcuserdata/ttscoff.xcuserdatad/xcschemes/xcschememanagement.plist +0 -99
  479. data/ext/apex_ext/apex_src/xcode_build/cmake_install.cmake +0 -452
  480. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/CMakeScripts/ReRunCMake.make +0 -52
  481. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmake_install.cmake +0 -55
  482. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.pbxproj +0 -2455
  483. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/cmark-gfm.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
  484. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/extensions/cmake_install.cmake +0 -171
  485. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/man/cmake_install.cmake +0 -55
  486. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmake_install.cmake +0 -220
  487. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_export.h +0 -43
  488. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/cmark-gfm_version.h +0 -7
  489. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/config.h +0 -76
  490. data/ext/apex_ext/apex_src/xcode_build/vendor/cmark-gfm/src/libcmark-gfm.pc +0 -10
@@ -1,1298 +0,0 @@
1
- /**
2
- * Tables Tests
3
- */
4
-
5
- #include "test_helpers.h"
6
- #include "apex/apex.h"
7
- #include <string.h>
8
- #include <stdlib.h>
9
- #include <stdbool.h>
10
- #include <stdio.h>
11
-
12
- void test_advanced_tables(void) {
13
- int suite_failures = suite_start();
14
- print_suite_title("Advanced Tables Tests", false, true);
15
-
16
- apex_options opts = apex_options_default();
17
- opts.enable_tables = true;
18
- opts.relaxed_tables = false; /* Use standard GFM table syntax for these tests */
19
- char *html;
20
-
21
- /* Test table with caption before table */
22
- const char *caption_table = "[Table Caption]\n\n| H1 | H2 |\n|----|----|"
23
- "\n| C1 | C2 |";
24
- html = apex_markdown_to_html(caption_table, strlen(caption_table), &opts);
25
- assert_contains(html, "<table", "Caption table renders");
26
- assert_contains(html, "<figure", "Caption table wrapped in figure");
27
- assert_contains(html, "<figcaption>", "Caption has figcaption tag");
28
- assert_contains(html, "Table Caption", "Caption text is present");
29
- assert_contains(html, "</figure>", "Caption figure is closed");
30
- apex_free_string(html);
31
-
32
- /* Test table with caption after table */
33
- const char *caption_table_after = "| H1 | H2 |\n|----|----|"
34
- "\n| C1 | C2 |\n\n[Table Caption After]";
35
- html = apex_markdown_to_html(caption_table_after, strlen(caption_table_after), &opts);
36
- assert_contains(html, "<table", "Caption table after renders");
37
- assert_contains(html, "<figure", "Caption table after wrapped in figure");
38
- assert_contains(html, "Table Caption After", "Caption text after is present");
39
- apex_free_string(html);
40
-
41
- /* Regression: footnote definitions must not be interpreted as table captions.
42
- * Repro from issue #20: inline table followed by [^1]: ...
43
- */
44
- apex_options inline_table_opts = apex_options_default();
45
- inline_table_opts.enable_marked_extensions = true;
46
- const char *inline_table_footnote_caption_regression =
47
- "Lorem ipsum dolor sit amet[^1], fabulas propriae signiferumque in ius.\n\n"
48
- "<<[Table.csv{;}]\n\n"
49
- "[^1]: Lorem is a good guy\n";
50
- html = apex_markdown_to_html(inline_table_footnote_caption_regression,
51
- strlen(inline_table_footnote_caption_regression),
52
- &inline_table_opts);
53
- assert_not_contains(html, "<figcaption>^1</figcaption>",
54
- "Footnote definition is not treated as table caption");
55
- apex_free_string(html);
56
-
57
- const char *inline_table_linkdef_caption_regression =
58
- "Lorem ipsum dolor sit amet [link-ref].\n\n"
59
- "<<[Table.csv{;}]\n\n"
60
- "[link-ref]: https://example.com\n";
61
- html = apex_markdown_to_html(inline_table_linkdef_caption_regression,
62
- strlen(inline_table_linkdef_caption_regression),
63
- &inline_table_opts);
64
- assert_not_contains(html, "<figcaption>link-ref</figcaption>",
65
- "Link definition is not treated as table caption");
66
- apex_free_string(html);
67
-
68
- const char *gfm_table_footnote_caption_regression =
69
- "Lorem ipsum dolor sit amet[^1], fabulas propriae signiferumque in ius.\n\n"
70
- "| Lorem | Dolor | Sit |\n"
71
- "| ------------- | ------- | ------- |\n"
72
- "| Amet | Fabulas | Propiae |\n"
73
- "| Signiferumque | In | Ius |\n\n"
74
- "[^1]: Lorem is a good guy\n";
75
- html = apex_markdown_to_html(gfm_table_footnote_caption_regression,
76
- strlen(gfm_table_footnote_caption_regression),
77
- &opts);
78
- assert_contains(html, "<table", "GFM table renders in footnote-caption regression");
79
- assert_not_contains(html, "<figcaption>^1</figcaption>",
80
- "Footnote definition after GFM table is not treated as caption");
81
- apex_free_string(html);
82
-
83
- /* Regression (#22): caption from inclusion-table section must not leak to nearby tables
84
- * that do not define their own caption.
85
- */
86
- const char *inclusion_caption_leak_regression =
87
- "**First table**\n\n"
88
- "| Lorem | Dolor | Sit |\n"
89
- "| ------------- | ------- | ------- |\n"
90
- "| Amet | Fabulas | Propiae |\n"
91
- "| Signiferumque | In | Ius |\n"
92
- ": My little table caption\n\n"
93
- "**Second table**\n\n"
94
- "| Lorem | Dolor | Sit |\n"
95
- "| ------------- | ------- | ------- |\n"
96
- "| Amet | Fabulas | Propiae |\n"
97
- "| Signiferumque | In | Ius |\n\n"
98
- "**Inclusion Table**\n\n"
99
- "<<[Table.csv]\n"
100
- ": Caption for inclusion table\n\n"
101
- "**Third table**\n\n"
102
- "| Lorem | Dolor | Sit |\n"
103
- "| ------------- | ------- | ------- |\n"
104
- "| Amet | Fabulas | Propiae |\n"
105
- "| Signiferumque | In | Ius |\n";
106
- html = apex_markdown_to_html(inclusion_caption_leak_regression,
107
- strlen(inclusion_caption_leak_regression),
108
- &inline_table_opts);
109
- assert_contains(html, "My little table caption",
110
- "Own caption remains attached to first table");
111
- assert_not_contains(html, "data-caption=\"Caption for inclusion table\"",
112
- "Inclusion-table caption does not leak into other table attributes");
113
- assert_not_contains(html, "<figcaption>Caption for inclusion table</figcaption>",
114
- "Inclusion-table caption does not leak into other table figure captions");
115
- apex_free_string(html);
116
-
117
- /* Regression (#20 comment): <<[file] include must not treat following
118
- * definition lines as include addresses or table captions.
119
- */
120
- const char *include_csv_path = "/tmp/apex_issue20_include_table.csv";
121
- FILE *include_csv = fopen(include_csv_path, "w");
122
- if (include_csv) {
123
- fputs("H1,H2\nA,B\n", include_csv);
124
- fclose(include_csv);
125
- }
126
-
127
- char include_table_footnote_def_regression[512];
128
- snprintf(include_table_footnote_def_regression,
129
- sizeof(include_table_footnote_def_regression),
130
- "<<[%s]\n\n[^1]: Some Footnote Text\n",
131
- include_csv_path);
132
- html = apex_markdown_to_html(include_table_footnote_def_regression,
133
- strlen(include_table_footnote_def_regression),
134
- &inline_table_opts);
135
- assert_contains(html, "<table", "Include-table with real CSV renders");
136
- assert_not_contains(html, "<figcaption>Some Footnote Text</figcaption>",
137
- "Footnote definition after <<[file] is not treated as caption");
138
- apex_free_string(html);
139
-
140
- char include_table_link_def_regression[512];
141
- snprintf(include_table_link_def_regression,
142
- sizeof(include_table_link_def_regression),
143
- "<<[%s]\n\n[link-ref]: https://example.com\n",
144
- include_csv_path);
145
- html = apex_markdown_to_html(include_table_link_def_regression,
146
- strlen(include_table_link_def_regression),
147
- &inline_table_opts);
148
- assert_contains(html, "<table", "Include-table with link definition renders");
149
- assert_not_contains(html, "<figcaption>https://example.com</figcaption>",
150
- "Link definition after <<[file] is not treated as caption");
151
- apex_free_string(html);
152
-
153
- remove(include_csv_path);
154
-
155
- /* Test rowspan with ^^ */
156
- const char *rowspan_table = "| H1 | H2 |\n|----|----|"
157
- "\n| A | B |"
158
- "\n| ^^ | C |";
159
- html = apex_markdown_to_html(rowspan_table, strlen(rowspan_table), &opts);
160
- assert_contains(html, "rowspan", "Rowspan attribute added");
161
- assert_contains(html, "<td rowspan=\"2\">A</td>", "Rowspan applied to first cell content");
162
- apex_free_string(html);
163
-
164
- /* Test tfoot support using === separator row.
165
- * The === row itself should be removed, and subsequent rows should be wrapped in <tfoot>.
166
- */
167
- const char *tfoot_table =
168
- "| H1 | H2 |\n"
169
- "|----|----|\n"
170
- "| A | B |\n"
171
- "| C | D |\n"
172
- "| E | F |\n"
173
- "| === | === |\n"
174
- "| F1 | F2 |\n";
175
- /* tfoot detection/mapping is more reliable with relaxed tables enabled (unified default). */
176
- apex_options tfoot_opts = opts;
177
- tfoot_opts.relaxed_tables = true;
178
- html = apex_markdown_to_html(tfoot_table, strlen(tfoot_table), &tfoot_opts);
179
- assert_contains(html, "<tfoot>", "Tfoot: footer section opened");
180
- assert_contains(html, "F1", "Tfoot: footer content present");
181
- assert_not_contains(html, "===", "Tfoot: === marker row removed");
182
- apex_free_string(html);
183
-
184
- /* Test colspan with consecutive pipes (|||) */
185
- const char *colspan_table = "| H1 | H2 | H3 |\n|----|----|----|"
186
- "\n| A |||"
187
- "\n| B | C | D |";
188
- html = apex_markdown_to_html(colspan_table, strlen(colspan_table), &opts);
189
- assert_contains(html, "colspan", "Colspan attribute added");
190
- /* A should span all three columns in the first data row */
191
- assert_contains(html, "<td colspan=\"3\">A</td>", "Colspan applied to first row A spanning 3 columns with consecutive pipes");
192
- apex_free_string(html);
193
-
194
- /* Test colspan only when cell contains nothing but << and optional whitespace.
195
- * A cell with "**<<**" or "raw <<" must NOT be colspan; only bare "<<" (or " << ") is.
196
- */
197
- const char *colspan_only_bare =
198
- "| H1 | H2 | H3 |\n"
199
- "|----|----|----|\n"
200
- "| A | B | << |\n"
201
- "| C | D | E |\n";
202
- html = apex_markdown_to_html(colspan_only_bare, strlen(colspan_only_bare), &opts);
203
- assert_contains(html, "colspan", "Colspan only when cell is just << (and optional whitespace)");
204
- apex_free_string(html);
205
-
206
- /* Test that empty cells with whitespace do NOT create colspan */
207
- const char *empty_cells_table = "| H1 | H2 | H3 |\n|----|----|----|"
208
- "\n| A | | |"
209
- "\n| B | C | D |";
210
- html = apex_markdown_to_html(empty_cells_table, strlen(empty_cells_table), &opts);
211
- assert_contains(html, "<td>A</td>", "Empty cells table: A cell present");
212
- assert_contains(html, "<td></td>", "Empty cells table: empty cell present (not merged)");
213
- assert_not_contains(html, "colspan", "Empty cells table: no colspan attribute (empty cells don't create colspan)");
214
- apex_free_string(html);
215
-
216
- /* Blank cells use spaced pipes (| |); colspan only for consecutive pipes (||).
217
- * A later full-width colspan row must not steal blanks from earlier indent rows. */
218
- const char *blank_then_colspan =
219
- "|:-|:-|:-|:-|:-|\n"
220
- "|a|b|c|d|e|\n"
221
- "| | |x|y|z|\n"
222
- "| | |p|q|r|\n"
223
- "|full|||||\n";
224
- html = apex_markdown_to_html(blank_then_colspan, strlen(blank_then_colspan), &opts);
225
- assert_contains(html, "<td colspan=\"5\">full</td>", "Blank then colspan: full-width colspan on last row");
226
- assert_contains(html, ">x</td>", "Blank then colspan: indent cell x present");
227
- assert_contains(html, ">p</td>", "Blank then colspan: indent cell p present");
228
- /* First indent row should keep two leading blank cells, not a colspan on an empty cell */
229
- assert_not_contains(html, "<td colspan=\"5\"></td>", "Blank then colspan: no empty-cell colspan on indent rows");
230
- assert_not_contains(html, "<th colspan=\"5\"></th>", "Blank then colspan: no empty th colspan on indent rows");
231
- apex_free_string(html);
232
-
233
- /* Spaced empty cell between content stays a blank column, not a span */
234
- const char *spaced_blank_between =
235
- "| H1 | H2 | H3 |\n"
236
- "|----|----|----|\n"
237
- "| A | | B |\n";
238
- html = apex_markdown_to_html(spaced_blank_between, strlen(spaced_blank_between), &opts);
239
- assert_contains(html, "<td>A</td>", "Spaced blank between: A present");
240
- assert_contains(html, "<td></td>", "Spaced blank between: blank cell present");
241
- assert_contains(html, "<td>B</td>", "Spaced blank between: B present");
242
- assert_not_contains(html, "colspan", "Spaced blank between: no colspan from | |");
243
- apex_free_string(html);
244
-
245
- /* Test dash-only separator row removal (rows containing only — should be removed). */
246
- const char *dash_row =
247
- "| H1 | H2 |\n"
248
- "|----|----|\n"
249
- "| A | B |\n"
250
- "| — | — |\n"
251
- "| C | D |\n";
252
- html = apex_markdown_to_html(dash_row, strlen(dash_row), &opts);
253
- assert_contains(html, "<td>A</td>", "Dash row: first row present");
254
- assert_contains(html, "<td>C</td>", "Dash row: row after dash separator present");
255
- assert_not_contains(html, "<td>—</td>", "Dash row: em-dash-only row removed");
256
- apex_free_string(html);
257
-
258
- /* Test per-cell alignment marker parsing in cell content:
259
- * these markers should be stripped from the rendered cell content.
260
- * (Alignment styling is handled in HTML postprocessing; here we assert the markers don't leak.)
261
- */
262
- apex_options cell_align_opts = opts;
263
- cell_align_opts.enable_emoji_autocorrect = false; /* Avoid :x: / :X: emoji autocorrect interference */
264
- const char *cell_align =
265
- "| H1 | H2 | H3 |\n"
266
- "|----|----|----|\n"
267
- "| :L | :X: | R: |\n";
268
- html = apex_markdown_to_html(cell_align, strlen(cell_align), &cell_align_opts);
269
- assert_not_contains(html, ":L", "Cell alignment marker: leading colon stripped");
270
- assert_not_contains(html, ":X:", "Cell alignment marker: both colons stripped");
271
- assert_not_contains(html, "R:", "Cell alignment marker: trailing colon stripped");
272
- assert_contains(html, "<td>L</td>", "Cell alignment marker: left content preserved");
273
- assert_contains(html, "<td>X</td>", "Cell alignment marker: center content preserved");
274
- assert_contains(html, "<td>R</td>", "Cell alignment marker: right content preserved");
275
- apex_free_string(html);
276
-
277
- /* Test per-cell alignment using colons */
278
- const char *align_table = "| h1 | h2 | h3 |\n"
279
- "| --- | :---: | --- |\n"
280
- "| d1 | d2 | d3 |";
281
- html = apex_markdown_to_html(align_table, strlen(align_table), &opts);
282
- /* cmark-gfm uses align=\"left|center|right\" attributes rather than inline styles */
283
- assert_contains(html, "<th>h1</th>", "Left-aligned header from colon pattern");
284
- /* Accept either align="center" or style="text-align: center" */
285
- bool has_align = strstr(html, "<th align=\"center\">h2</th") != NULL;
286
- bool has_style = strstr(html, "<th style=\"text-align: center\">h2</th") != NULL;
287
- if (has_align || has_style) {
288
- test_result(true, "Center-aligned header from colon pattern");
289
- } else {
290
- tests_failed++;
291
- tests_run++;
292
- printf(COLOR_RED "✗" COLOR_RESET " Center-aligned header from colon pattern\n");
293
- printf(" Looking for: <th align=\"center\">h2</th> or <th style=\"text-align: center\">h2</th>\n");
294
- printf(" In: %s\n", html);
295
- }
296
- apex_free_string(html);
297
-
298
- /* Test basic table (ensure we didn't break existing functionality) */
299
- const char *basic_table = "| H1 | H2 |\n|-----|-----|\n| C1 | C2 |";
300
- html = apex_markdown_to_html(basic_table, strlen(basic_table), &opts);
301
- assert_contains(html, "<table>", "Basic table still works");
302
- assert_contains(html, "<th>H1</th>", "Table header");
303
- assert_contains(html, "<td>C1</td>", "Table cell");
304
- apex_free_string(html);
305
-
306
- /* Test row header column when first header cell is empty */
307
- const char *row_header_table =
308
- "| | H1 | H2 |\n"
309
- "|----|----|----|\n"
310
- "| Row 1 | A1 | B1 |\n"
311
- "| Row 2 | A2 | B2 |";
312
- html = apex_markdown_to_html(row_header_table, strlen(row_header_table), &opts);
313
- assert_contains(html, "<table>", "Row-header table renders");
314
- /* Check for th with scope="row" - the first column cells in tbody should be converted to row headers */
315
- /* Check for the pattern: <th scope="row"> followed by Row 1 or Row 2 */
316
- bool has_row_scope_1 = (strstr(html, "<th scope=\"row\">Row 1</th>") != NULL) ||
317
- (strstr(html, "scope=\"row\">Row 1") != NULL);
318
- bool has_row_scope_2 = (strstr(html, "<th scope=\"row\">Row 2</th>") != NULL) ||
319
- (strstr(html, "scope=\"row\">Row 2") != NULL);
320
- if (has_row_scope_1 && has_row_scope_2) {
321
- test_result(true, "Row-header table: first row header cell");
322
- test_result(true, "Row-header table: second row header cell");
323
- } else {
324
- tests_failed += 2;
325
- tests_run += 2;
326
- printf(COLOR_RED "✗" COLOR_RESET " Row-header table: first row header cell\n");
327
- printf(COLOR_RED "✗" COLOR_RESET " Row-header table: second row header cell\n");
328
- printf(" Looking for: <th scope=\"row\">Row 1</th> and <th scope=\"row\">Row 2</th>\n");
329
- printf(" In: %s\n", html);
330
- }
331
- assert_contains(html, "<td>A1</td>", "Row-header table: body cell A1");
332
- apex_free_string(html);
333
-
334
- /* Test table followed by paragraph (regression: last row should not become paragraph) */
335
- const char *table_with_text = "| H1 | H2 |\n|-----|-----|\n| C1 | C2 |\n| C3 | C4 |\n\nText after.";
336
- html = apex_markdown_to_html(table_with_text, strlen(table_with_text), &opts);
337
- assert_contains(html, "<td>C3</td>", "Last table row C3 in table");
338
- assert_contains(html, "<td>C4</td>", "Last table row C4 in table");
339
- assert_contains(html, "</table>\n<p>Text after.</p>", "Table properly closed before paragraph");
340
- apex_free_string(html);
341
-
342
- /* Test : Caption syntax BEFORE table */
343
- const char *colon_caption_before = ": My Table\n\n| Col1 | Col2 |\n|------|------|\n| A | B |";
344
- html = apex_markdown_to_html(colon_caption_before, strlen(colon_caption_before), &opts);
345
- assert_contains(html, "<figcaption>", ": Caption before table has figcaption tag");
346
- assert_contains(html, "My Table", ": Caption before table text is present");
347
- assert_contains(html, "<table", "Table with : Caption before renders");
348
- assert_not_contains(html, "<p>: My Table</p>", ": Caption before table paragraph removed");
349
- apex_free_string(html);
350
-
351
- /* Test : Caption syntax BEFORE table with IAL */
352
- const char *colon_caption_before_ial = ": My Table {#table-id .highlight}\n\n| Col1 | Col2 |\n|------|------|\n| A | B |";
353
- html = apex_markdown_to_html(colon_caption_before_ial, strlen(colon_caption_before_ial), &opts);
354
- assert_contains(html, "<figcaption>", ": Caption before table with IAL has figcaption tag");
355
- assert_contains(html, "My Table", ": Caption before table with IAL text is present");
356
- assert_contains(html, "id=\"table-id\"", ": Caption before table IAL ID applied");
357
- assert_contains(html, "class=\"highlight\"", ": Caption before table IAL class applied");
358
- assert_not_contains(html, "<p>: My Table", ": Caption before table with IAL paragraph removed");
359
- apex_free_string(html);
360
-
361
- /* Test : Caption syntax BEFORE table without blank line */
362
- const char *colon_caption_before_no_blank = ": Caption No Blank\n| Col1 | Col2 |\n|------|------|\n| A | B |";
363
- html = apex_markdown_to_html(colon_caption_before_no_blank, strlen(colon_caption_before_no_blank), &opts);
364
- assert_contains(html, "<figcaption>", ": Caption before table no blank has figcaption tag");
365
- assert_contains(html, "Caption No Blank", ": Caption before table no blank text is present");
366
- assert_contains(html, "<table", "Table with : Caption before no blank renders");
367
- apex_free_string(html);
368
-
369
- /* Test Pandoc-style table caption with : Caption syntax AFTER table */
370
- const char *pandoc_caption = "| Key | Value |\n| --- | :---: |\n| one | 1 |\n| two | 2 |\n\n: Key value table";
371
- html = apex_markdown_to_html(pandoc_caption, strlen(pandoc_caption), &opts);
372
- assert_contains(html, "<figcaption>", "Pandoc caption has figcaption tag");
373
- assert_contains(html, "Key value table", "Pandoc caption text is present");
374
- assert_contains(html, "<table", "Table with Pandoc caption renders");
375
- apex_free_string(html);
376
-
377
- /* Test Pandoc-style table caption with IAL attributes (Kramdown format) */
378
- const char *pandoc_caption_ial_kramdown = "| Key | Value |\n| --- | :---: |\n| one | 1 |\n| two | 2 |\n\n: Key value table {: #table-id .testing}";
379
- html = apex_markdown_to_html(pandoc_caption_ial_kramdown, strlen(pandoc_caption_ial_kramdown), &opts);
380
- assert_contains(html, "<table", "Table with Pandoc caption and IAL renders");
381
- assert_contains(html, "id=\"table-id\"", "Table IAL ID from caption applied");
382
- assert_contains(html, "class=\"testing\"", "Table IAL class from caption applied");
383
- assert_contains(html, "Key value table", "Caption text is present");
384
- apex_free_string(html);
385
-
386
- /* Test Pandoc-style table caption with IAL attributes (Pandoc format) */
387
- const char *pandoc_caption_ial_pandoc = "| Key | Value |\n| --- | :---: |\n| one | 1 |\n| two | 2 |\n\n: Key value table {#table-id-2 .testing-2}";
388
- html = apex_markdown_to_html(pandoc_caption_ial_pandoc, strlen(pandoc_caption_ial_pandoc), &opts);
389
- assert_contains(html, "<table", "Table with Pandoc caption and Pandoc IAL renders");
390
- assert_contains(html, "id=\"table-id-2\"", "Table Pandoc IAL ID from caption applied");
391
- assert_contains(html, "class=\"testing-2\"", "Table Pandoc IAL class from caption applied");
392
- assert_contains(html, "Key value table", "Caption text is present");
393
- apex_free_string(html);
394
-
395
- /* Test table with IAL applied directly (not via caption) */
396
- const char *table_with_direct_ial = "| H1 | H2 |\n|----|----|\n| C1 | C2 |\n{: #direct-table .direct-class}";
397
- html = apex_markdown_to_html(table_with_direct_ial, strlen(table_with_direct_ial), &opts);
398
- assert_contains(html, "<table", "Table with direct IAL renders");
399
- assert_contains(html, "id=\"direct-table\"", "Direct table IAL ID applied");
400
- assert_contains(html, "class=\"direct-class\"", "Direct table IAL class applied");
401
- apex_free_string(html);
402
-
403
- /* Test table caption before table with IAL */
404
- const char *caption_before_ial = "[Caption Before]\n\n| H1 | H2 |\n|----|----|\n| C1 | C2 |\n{: #before-table .before-class}";
405
- html = apex_markdown_to_html(caption_before_ial, strlen(caption_before_ial), &opts);
406
- assert_contains(html, "<table", "Table with caption before and IAL renders");
407
- assert_contains(html, "Caption Before", "Caption text before table");
408
- assert_contains(html, "id=\"before-table\"", "Table IAL ID with caption before");
409
- assert_contains(html, "class=\"before-class\"", "Table IAL class with caption before");
410
- apex_free_string(html);
411
-
412
- bool had_failures = suite_end(suite_failures);
413
- print_suite_title("Advanced Tables Tests", had_failures, false);
414
- }
415
-
416
- /**
417
- * Test relaxed tables (tables without separator rows)
418
- */
419
-
420
- void test_relaxed_tables(void) {
421
- int suite_failures = suite_start();
422
- print_suite_title("Relaxed Tables Tests", false, true);
423
-
424
- apex_options opts = apex_options_default();
425
- opts.enable_tables = true;
426
- opts.relaxed_tables = true;
427
- char *html;
428
-
429
- /* Test basic relaxed table (2 rows, no separator) */
430
- const char *relaxed_table = "A | B\n1 | 2";
431
- html = apex_markdown_to_html(relaxed_table, strlen(relaxed_table), &opts);
432
- assert_contains(html, "<table>", "Relaxed table renders");
433
- assert_contains(html, "<tbody>", "Relaxed table has tbody");
434
- assert_contains(html, "<tr>", "Relaxed table has rows");
435
- assert_contains(html, "<td>A</td>", "First cell A");
436
- assert_contains(html, "<td>B</td>", "First cell B");
437
- assert_contains(html, "<td>1</td>", "Second cell 1");
438
- assert_contains(html, "<td>2</td>", "Second cell 2");
439
- /* Should NOT have a header row */
440
- if (strstr(html, "<thead>") == NULL && strstr(html, "<th>") == NULL) {
441
- test_result(true, "Relaxed table has no header row");
442
- } else {
443
- tests_failed++;
444
- tests_run++;
445
- printf(COLOR_RED "✗" COLOR_RESET " Relaxed table incorrectly has header row\n");
446
- }
447
- apex_free_string(html);
448
-
449
- /* Test relaxed table with 3 rows */
450
- const char *relaxed_table3 = "A | B\n1 | 2\n3 | 4";
451
- html = apex_markdown_to_html(relaxed_table3, strlen(relaxed_table3), &opts);
452
- assert_contains(html, "<table>", "Relaxed table with 3 rows renders");
453
- assert_contains(html, "<td>3</td>", "Third row cell 3");
454
- assert_contains(html, "<td>4</td>", "Third row cell 4");
455
- apex_free_string(html);
456
-
457
- /* Test relaxed table stops at blank line */
458
- const char *relaxed_table_blank = "A | B\n1 | 2\n\nParagraph text";
459
- html = apex_markdown_to_html(relaxed_table_blank, strlen(relaxed_table_blank), &opts);
460
- assert_contains(html, "<table>", "Relaxed table before blank line");
461
- assert_contains(html, "<p>Paragraph text</p>", "Paragraph after blank line");
462
- apex_free_string(html);
463
-
464
- /* Test relaxed table with leading pipe */
465
- const char *relaxed_table_leading = "| A | B |\n| 1 | 2 |";
466
- html = apex_markdown_to_html(relaxed_table_leading, strlen(relaxed_table_leading), &opts);
467
- assert_contains(html, "<table>", "Relaxed table with leading pipe renders");
468
- assert_contains(html, "<td>A</td>", "Cell A with leading pipe");
469
- apex_free_string(html);
470
-
471
- /* Test that relaxed tables are disabled by default in GFM mode */
472
- apex_options gfm_opts = apex_options_for_mode(APEX_MODE_GFM);
473
- gfm_opts.enable_tables = true;
474
- html = apex_markdown_to_html(relaxed_table, strlen(relaxed_table), &gfm_opts);
475
- if (strstr(html, "<table>") == NULL) {
476
- test_result(true, "Relaxed tables disabled in GFM mode by default");
477
- } else {
478
- test_result(false, "Relaxed tables incorrectly enabled in GFM mode");
479
- }
480
- apex_free_string(html);
481
-
482
- /* Test that relaxed tables are enabled by default in Kramdown mode */
483
- apex_options kramdown_opts = apex_options_for_mode(APEX_MODE_KRAMDOWN);
484
- kramdown_opts.enable_tables = true;
485
- html = apex_markdown_to_html(relaxed_table, strlen(relaxed_table), &kramdown_opts);
486
- if (strstr(html, "<table>") != NULL) {
487
- test_result(true, "Relaxed tables enabled in Kramdown mode by default");
488
- } else {
489
- test_result(false, "Relaxed tables incorrectly disabled in Kramdown mode");
490
- }
491
- apex_free_string(html);
492
-
493
- /* Test that relaxed tables are enabled by default in Unified mode */
494
- apex_options unified_opts = apex_options_for_mode(APEX_MODE_UNIFIED);
495
- unified_opts.enable_tables = true;
496
- html = apex_markdown_to_html(relaxed_table, strlen(relaxed_table), &unified_opts);
497
- if (strstr(html, "<table>") != NULL) {
498
- test_result(true, "Relaxed tables enabled in Unified mode by default");
499
- } else {
500
- test_result(false, "Relaxed tables incorrectly disabled in Unified mode");
501
- }
502
- apex_free_string(html);
503
-
504
- /* Test that --no-relaxed-tables disables it even in Kramdown mode */
505
- apex_options no_relaxed = apex_options_for_mode(APEX_MODE_KRAMDOWN);
506
- no_relaxed.enable_tables = true;
507
- no_relaxed.relaxed_tables = false;
508
- html = apex_markdown_to_html(relaxed_table, strlen(relaxed_table), &no_relaxed);
509
- if (strstr(html, "<table>") == NULL) {
510
- test_result(true, "--no-relaxed-tables disables relaxed tables");
511
- } else {
512
- test_result(false, "--no-relaxed-tables did not disable relaxed tables");
513
- }
514
- apex_free_string(html);
515
-
516
- /* Test that single row with pipe is not treated as table */
517
- const char *single_row = "A | B";
518
- html = apex_markdown_to_html(single_row, strlen(single_row), &opts);
519
- if (strstr(html, "<table>") == NULL) {
520
- test_result(true, "Single row is not treated as table");
521
- } else {
522
- test_result(false, "Single row incorrectly treated as table");
523
- }
524
- apex_free_string(html);
525
-
526
- /* Test that rows with different column counts are not treated as table */
527
- const char *mismatched = "A | B\n1 | 2 | 3";
528
- html = apex_markdown_to_html(mismatched, strlen(mismatched), &opts);
529
- if (strstr(html, "<table>") == NULL) {
530
- test_result(true, "Mismatched column counts are not treated as table");
531
- } else {
532
- test_result(false, "Mismatched column counts incorrectly treated as table");
533
- }
534
- apex_free_string(html);
535
-
536
- /* Pipes inside fenced code blocks must not trigger relaxed table separators */
537
- const char *fenced_code_with_pipes =
538
- "```bash\n"
539
- "update_widgets() {\n"
540
- " echo foo | sed 's/x/y/' | awk '{print $1}'\n"
541
- "}\n"
542
- "```";
543
- html = apex_markdown_to_html(fenced_code_with_pipes, strlen(fenced_code_with_pipes), &opts);
544
- assert_contains(html, "<code", "Fenced code block with pipes renders as code");
545
- assert_contains(html, "echo foo | sed", "Code block content with pipes preserved");
546
- if (strstr(html, "---|---|---|") == NULL) {
547
- test_result(true, "No relaxed-table separator injected inside fenced code");
548
- } else {
549
- test_result(false, "Relaxed-table separator was injected inside fenced code");
550
- }
551
- apex_free_string(html);
552
-
553
- /* Mermaid edge labels |Yes| / |No| must not get a GFM separator injected */
554
- {
555
- apex_options unified = apex_options_default();
556
- unified.mode = APEX_MODE_UNIFIED;
557
- unified.relaxed_tables = true;
558
- unified.enable_tables = true;
559
- const char *mermaid_pipes =
560
- "```mermaid\n"
561
- "graph TD\n"
562
- " A -->|Yes| B\n"
563
- " A -->|No| C\n"
564
- "```\n";
565
- html = apex_markdown_to_html(mermaid_pipes, strlen(mermaid_pipes), &unified);
566
- assert_contains(html, "lang=\"mermaid\"", "Mermaid fence keeps language");
567
- assert_contains(html, "|Yes|", "Mermaid Yes edge label preserved");
568
- assert_contains(html, "|No|", "Mermaid No edge label preserved");
569
- assert_not_contains(html, "---|---|---", "No relaxed-table separator inside Mermaid fence");
570
- apex_free_string(html);
571
- }
572
-
573
- bool had_failures = suite_end(suite_failures);
574
- print_suite_title("Relaxed Tables Tests", had_failures, false);
575
- }
576
-
577
- /**
578
- * Test combine-like behavior for GitBook SUMMARY.md via core API
579
- * (indirectly validates that include expansion and ordering work).
580
- */
581
-
582
- void test_comprehensive_table_features(void) {
583
- int suite_failures = suite_start();
584
- print_suite_title("Comprehensive Test File Table Features", false, true);
585
-
586
- apex_options opts = apex_options_default();
587
- opts.enable_tables = true;
588
- char *html = NULL;
589
-
590
- /* Read comprehensive_test.md file */
591
- FILE *f = fopen("tests/fixtures/comprehensive_test.md", "r");
592
- if (!f) {
593
- tests_run++;
594
- tests_failed++;
595
- printf(COLOR_RED "✗" COLOR_RESET " comprehensive_test.md: Could not open file\n");
596
- return;
597
- }
598
-
599
- /* Get file size */
600
- fseek(f, 0, SEEK_END);
601
- long file_size = ftell(f);
602
- fseek(f, 0, SEEK_SET);
603
-
604
- /* Read file content */
605
- char *markdown = (char *)malloc(file_size + 1);
606
- if (!markdown) {
607
- fclose(f);
608
- tests_run++;
609
- tests_failed++;
610
- printf(COLOR_RED "✗" COLOR_RESET " comprehensive_test.md: Memory allocation failed\n");
611
- return;
612
- }
613
-
614
- size_t bytes_read = fread(markdown, 1, file_size, f);
615
- markdown[bytes_read] = '\0';
616
- fclose(f);
617
-
618
- /* Convert to HTML */
619
- html = apex_markdown_to_html(markdown, bytes_read, &opts);
620
- free(markdown);
621
-
622
- if (!html) {
623
- tests_run++;
624
- tests_failed++;
625
- printf(COLOR_RED "✗" COLOR_RESET " comprehensive_test.md: Failed to convert to HTML\n");
626
- return;
627
- }
628
-
629
- /* Test 1: Caption before table with IAL should render correctly */
630
- /* The caption "Employee Performance Q4 2025" should appear in figcaption, not as a paragraph */
631
- /* Note: Caption may appear as <p> if not properly detected, so check for either format */
632
- bool has_figcaption = strstr(html, "<figcaption>Employee Performance Q4 2025</figcaption>") != NULL;
633
- bool has_caption_para = strstr(html, "<p>[Employee Performance Q4 2025]</p>") != NULL;
634
- if (has_figcaption) {
635
- test_result(true, "Caption appears in figcaption tag");
636
- /* If in figcaption, it should NOT be in paragraph */
637
- if (!has_caption_para) {
638
- test_result(true, "Caption paragraph removed (no duplicate)");
639
- } else {
640
- tests_failed++;
641
- tests_run++;
642
- printf(COLOR_RED "✗" COLOR_RESET " Caption paragraph removed (no duplicate)\n");
643
- printf(" Caption found in both figcaption and paragraph\n");
644
- }
645
- } else if (has_caption_para) {
646
- /* Caption not in figcaption - this might be expected if caption detection isn't working */
647
- tests_failed++;
648
- tests_run++;
649
- printf(COLOR_RED "✗" COLOR_RESET " Caption appears in figcaption tag\n");
650
- printf(" Caption found as paragraph instead of figcaption\n");
651
- } else {
652
- /* Caption not found at all */
653
- tests_failed++;
654
- tests_run++;
655
- printf(COLOR_RED "✗" COLOR_RESET " Caption appears in figcaption tag\n");
656
- printf(" Caption 'Employee Performance Q4 2025' not found in output\n");
657
- }
658
-
659
- /* Test 3: Rowspan should be applied correctly - Engineering rowspan="2" */
660
- /* Note: Rowspan detection may require the ^^ marker to be in the correct cell position */
661
- assert_contains(html, "rowspan=\"2\"", "Rowspan attribute present");
662
- /* Check for Engineering with rowspan - may have alignment attribute */
663
- bool engineering_has_rowspan = strstr(html, "<td rowspan=\"2\">Engineering</td>") != NULL ||
664
- strstr(html, "<td align=\"right\" rowspan=\"2\">Engineering</td>") != NULL ||
665
- strstr(html, "rowspan=\"2\">Engineering") != NULL;
666
- if (engineering_has_rowspan) {
667
- test_result(true, "Engineering has rowspan=2");
668
- } else {
669
- tests_failed++;
670
- tests_run++;
671
- printf(COLOR_RED "✗" COLOR_RESET " Engineering has rowspan=2\n");
672
- printf(" Looking for: <td rowspan=\"2\">Engineering</td> or <td align=\"right\" rowspan=\"2\">Engineering</td>\n");
673
- printf(" In: %s\n", html);
674
- }
675
-
676
- /* Test 4: Rowspan should be applied correctly - Sales rowspan="2" */
677
- /* Check for Sales with rowspan - may have alignment attribute */
678
- bool sales_has_rowspan = strstr(html, "<td rowspan=\"2\">Sales</td>") != NULL ||
679
- strstr(html, "<td align=\"right\" rowspan=\"2\">Sales</td>") != NULL ||
680
- strstr(html, "rowspan=\"2\">Sales") != NULL;
681
- if (sales_has_rowspan) {
682
- test_result(true, "Sales has rowspan=2");
683
- } else {
684
- tests_failed++;
685
- tests_run++;
686
- printf(COLOR_RED "✗" COLOR_RESET " Sales has rowspan=2\n");
687
- printf(" Looking for: <td rowspan=\"2\">Sales</td> or <td align=\"right\" rowspan=\"2\">Sales</td>\n");
688
- printf(" In: %s\n", html);
689
- }
690
-
691
- /* Test 5: Table should be wrapped in figure tag */
692
- assert_contains(html, "<figure class=\"table-figure\">", "Table wrapped in figure with class");
693
-
694
- /* Test 6: Empty cells are preserved (Absent cell followed by empty cells) */
695
- /* The comprehensive test shows: | Marketing | Charlie | Absent | | | 92.00 | */
696
- /* This means: Marketing, Charlie, Absent, then empty cells, then 92.00 */
697
- /* Empty cells with whitespace should NOT create colspan, they should remain as empty cells */
698
- assert_contains(html, "<td>Absent</td>", "Absent cell present");
699
- /* Check for empty cell after Absent - empty cells should remain as <td></td> not merged */
700
- bool has_empty_after_absent = strstr(html, "<td>Absent</td><td></td>") != NULL ||
701
- strstr(html, "<td>Absent</td>\n<td></td>") != NULL ||
702
- (strstr(html, "<td>Absent</td>") != NULL && strstr(html, "<td></td>") != NULL);
703
- if (has_empty_after_absent) {
704
- test_result(true, "Empty cell present in table");
705
- } else {
706
- tests_failed++;
707
- tests_run++;
708
- printf(COLOR_RED "✗" COLOR_RESET " Empty cell present in table\n");
709
- printf(" Looking for: <td>Absent</td> followed by <td></td> (empty cells don't create colspan)\n");
710
- printf(" In: %s\n", html);
711
- }
712
-
713
- /* Test 7: Table structure should be correct - key rows present */
714
- assert_contains(html, "<td>Alice</td>", "Alice row present");
715
- assert_contains(html, "<td>Bob</td>", "Bob row present");
716
- assert_contains(html, "<td>Charlie</td>", "Charlie row present");
717
- assert_contains(html, "<td>Diana</td>", "Diana row present");
718
- /* Eve is in the last row with rowspan */
719
- assert_contains(html, "Eve", "Eve row present");
720
-
721
- apex_free_string(html);
722
-
723
- bool had_failures = suite_end(suite_failures);
724
- print_suite_title("Comprehensive Test File Table Features", had_failures, false);
725
- }
726
-
727
- /**
728
- * Test that table parsing works correctly when file doesn't end with a newline.
729
- * This ensures the last row of the first table is properly parsed and not rendered as text.
730
- */
731
- void test_table_no_trailing_newline(void) {
732
- int suite_failures = suite_start();
733
- print_suite_title("Table No Trailing Newline Test", false, true);
734
-
735
- apex_options opts = apex_options_default();
736
- opts.enable_tables = true;
737
- opts.relaxed_tables = false;
738
- char *html = NULL;
739
-
740
- /* Read table_no_trailing_newline.md file (which intentionally doesn't end with newline) */
741
- FILE *f = fopen("tests/fixtures/tables/table_no_trailing_newline.md", "r");
742
- if (!f) {
743
- tests_run++;
744
- tests_failed++;
745
- printf(COLOR_RED "✗" COLOR_RESET " table_no_trailing_newline.md: Could not open file\n");
746
- return;
747
- }
748
-
749
- /* Get file size */
750
- fseek(f, 0, SEEK_END);
751
- long file_size = ftell(f);
752
- fseek(f, 0, SEEK_SET);
753
-
754
- /* Read file content */
755
- char *markdown = (char *)malloc(file_size + 1);
756
- if (!markdown) {
757
- fclose(f);
758
- tests_run++;
759
- tests_failed++;
760
- printf(COLOR_RED "✗" COLOR_RESET " table_no_trailing_newline.md: Memory allocation failed\n");
761
- return;
762
- }
763
-
764
- size_t bytes_read = fread(markdown, 1, file_size, f);
765
- markdown[bytes_read] = '\0';
766
- fclose(f);
767
-
768
- /* Verify file doesn't end with newline (key part of the test) */
769
- if (bytes_read > 0 && (markdown[bytes_read - 1] == '\n' || markdown[bytes_read - 1] == '\r')) {
770
- free(markdown);
771
- tests_run++;
772
- tests_failed++;
773
- printf(COLOR_RED "✗" COLOR_RESET " table_no_trailing_newline.md: File ends with newline (should not)\n");
774
- return;
775
- }
776
-
777
- /* Convert to HTML */
778
- html = apex_markdown_to_html(markdown, bytes_read, &opts);
779
- free(markdown);
780
-
781
- if (!html) {
782
- tests_run++;
783
- tests_failed++;
784
- printf(COLOR_RED "✗" COLOR_RESET " table_no_trailing_newline.md: Failed to convert to HTML\n");
785
- return;
786
- }
787
-
788
- /* Test 1: First table's last row should be parsed correctly - A and B should be in table cells */
789
- assert_contains(html, "<td>A</td>", "First table last row: A cell parsed correctly");
790
- assert_contains(html, "<td>B</td>", "First table last row: B cell parsed correctly");
791
-
792
- /* Test 2: The last row should NOT appear as raw text like "| A | B |" */
793
- assert_not_contains(html, "<p>| A | B |</p>", "First table last row: not rendered as paragraph text");
794
- assert_not_contains(html, "<p>| A | B |</p>", "First table last row: not rendered as paragraph text (alternate format)");
795
-
796
- /* Test 3: First table should be properly closed before the caption */
797
- assert_contains(html, "</table>", "First table properly closed");
798
- assert_contains(html, "<figcaption>", "Caption present after first table");
799
-
800
- /* Test 4: Second table should also be parsed correctly */
801
- assert_contains(html, "<table", "Second table renders");
802
- assert_contains(html, "My Table", "Caption text present");
803
-
804
- /* Test 5: Both tables should have their data rows */
805
- /* Count occurrences of table cells - should have at least 4 (2 tables * 2 cells each) */
806
- int td_count = 0;
807
- const char *td_pos = html;
808
- while ((td_pos = strstr(td_pos, "<td>")) != NULL) {
809
- td_count++;
810
- td_pos += 4;
811
- }
812
- if (td_count >= 4) {
813
- test_resultf(true, "Both tables have all data rows parsed (found %d cells)", td_count);
814
- } else {
815
- test_resultf(false, "Both tables should have all data rows (found %d cells, expected at least 4)", td_count);
816
- }
817
-
818
- apex_free_string(html);
819
-
820
- bool had_failures = suite_end(suite_failures);
821
- print_suite_title("Table No Trailing Newline Test", had_failures, false);
822
- }
823
-
824
- /**
825
- * Test that table parsing works correctly when file uses CR line endings.
826
- * This ensures Table: Caption syntax is processed correctly with CR line endings.
827
- */
828
- void test_table_cr_line_endings(void) {
829
- int suite_failures = suite_start();
830
- print_suite_title("Table CR Line Endings Test", false, true);
831
-
832
- apex_options opts = apex_options_default();
833
- opts.enable_tables = true;
834
- opts.relaxed_tables = false;
835
- char *html = NULL;
836
-
837
- /* Read table_cr_line_endings.md file (which intentionally uses CR line endings) */
838
- FILE *f = fopen("tests/fixtures/tables/table_cr_line_endings.md", "rb");
839
- if (!f) {
840
- tests_run++;
841
- tests_failed++;
842
- printf(COLOR_RED "✗" COLOR_RESET " table_cr_line_endings.md: Could not open file\n");
843
- return;
844
- }
845
-
846
- /* Get file size */
847
- fseek(f, 0, SEEK_END);
848
- long file_size = ftell(f);
849
- fseek(f, 0, SEEK_SET);
850
-
851
- /* Read file content as binary to preserve CR characters */
852
- char *markdown = (char *)malloc(file_size + 1);
853
- if (!markdown) {
854
- fclose(f);
855
- tests_run++;
856
- tests_failed++;
857
- printf(COLOR_RED "✗" COLOR_RESET " table_cr_line_endings.md: Memory allocation failed\n");
858
- return;
859
- }
860
-
861
- size_t bytes_read = fread(markdown, 1, file_size, f);
862
- markdown[bytes_read] = '\0';
863
- fclose(f);
864
-
865
- /* Verify file uses CR line endings (key part of the test) */
866
- bool has_cr = false;
867
- for (size_t i = 0; i < bytes_read; i++) {
868
- if (markdown[i] == '\r') has_cr = true;
869
- }
870
- if (!has_cr) {
871
- free(markdown);
872
- tests_run++;
873
- tests_failed++;
874
- printf(COLOR_RED "✗" COLOR_RESET " table_cr_line_endings.md: File does not use CR line endings (should not)\n");
875
- return;
876
- }
877
-
878
- /* Convert to HTML */
879
- html = apex_markdown_to_html(markdown, bytes_read, &opts);
880
- free(markdown);
881
-
882
- if (!html) {
883
- tests_run++;
884
- tests_failed++;
885
- printf(COLOR_RED "✗" COLOR_RESET " table_cr_line_endings.md: Failed to convert to HTML\n");
886
- return;
887
- }
888
-
889
- /* Test 1: First table should be parsed correctly */
890
- assert_contains(html, "<td>A</td>", "CR line endings: First table last row A cell parsed correctly");
891
- assert_contains(html, "<td>B</td>", "CR line endings: First table last row B cell parsed correctly");
892
-
893
- /* Test 2: Table: Caption should be processed correctly (not rendered as paragraph) */
894
- assert_contains(html, "<figcaption>", "CR line endings: Table: Caption has figcaption tag");
895
- assert_contains(html, "My Table", "CR line endings: Table: Caption text is present");
896
- assert_contains(html, "table-id2", "CR line endings: Table: Caption IAL ID applied");
897
-
898
- /* Test 3: Table: Caption should NOT appear as raw text like "<p>Table: My Table" */
899
- assert_not_contains(html, "<p>Table: My Table", "CR line endings: Table: Caption not rendered as paragraph text");
900
-
901
- /* Test 4: : Caption syntax should also work with CR line endings */
902
- assert_contains(html, "table-id", "CR line endings: : Caption IAL ID applied");
903
-
904
- /* Test 5: Both tables should be properly rendered */
905
- int table_count = 0;
906
- const char *table_pos = html;
907
- while ((table_pos = strstr(table_pos, "<table")) != NULL) {
908
- table_count++;
909
- table_pos += 6;
910
- }
911
- if (table_count >= 2) {
912
- test_resultf(true, "CR line endings: Both tables rendered correctly (found %d tables)", table_count);
913
- } else {
914
- test_resultf(false, "CR line endings: Both tables should be rendered (found %d tables, expected at least 2)", table_count);
915
- }
916
-
917
- apex_free_string(html);
918
-
919
- bool had_failures = suite_end(suite_failures);
920
- print_suite_title("Table CR Line Endings Test", had_failures, false);
921
- }
922
-
923
- /**
924
- * Test callouts (Bear/Obsidian/Xcode)
925
- */
926
-
927
- void test_inline_tables(void) {
928
- int suite_failures = suite_start();
929
- print_suite_title("Inline Tables Tests", false, true);
930
-
931
- apex_options opts = apex_options_default();
932
- opts.enable_marked_extensions = true;
933
- char *html;
934
-
935
- /* ```table fence with CSV data */
936
- const char *csv_table =
937
- "```table\n"
938
- "header 1,header 2,header 3\n"
939
- "data 1,data 2,data 3\n"
940
- ",,data 2c\n"
941
- "```\n";
942
- html = apex_markdown_to_html(csv_table, strlen(csv_table), &opts);
943
- assert_contains(html, "<table>", "CSV table fence: table element");
944
- assert_contains(html, "<th>header 1</th>", "CSV table fence: header 1");
945
- assert_contains(html, "<th>header 2</th>", "CSV table fence: header 2");
946
- assert_contains(html, "<th>header 3</th>", "CSV table fence: header 3");
947
- assert_contains(html, "<td>data 1</td>", "CSV table fence: first data cell");
948
- assert_contains(html, "<td>data 2c</td>", "CSV table fence: continued cell");
949
- apex_free_string(html);
950
-
951
- /* ```table fence with CSV data and alignment keywords */
952
- const char *csv_align =
953
- "```table\n"
954
- "H1,H2,H3\n"
955
- "left,center,right\n"
956
- "a,b,c\n"
957
- "```\n";
958
- html = apex_markdown_to_html(csv_align, strlen(csv_align), &opts);
959
- assert_contains(html, "<table>", "CSV table with alignment: table element");
960
- /* Be conservative about HTML structure: just verify content appears in a table */
961
- assert_contains(html, "H1", "CSV table with alignment: header text H1 present");
962
- assert_contains(html, "H2", "CSV table with alignment: header text H2 present");
963
- assert_contains(html, "H3", "CSV table with alignment: header text H3 present");
964
- assert_contains(html, "a", "CSV table with alignment: data 'a' present");
965
- apex_free_string(html);
966
-
967
- /* ```table fence with Markdown-style alignment (:--, --:, :--:) */
968
- const char *csv_align_colon_dash =
969
- "```table\n"
970
- "A,B,C\n"
971
- ":--,--:,:--:\n"
972
- "x,y,z\n"
973
- "```\n";
974
- html = apex_markdown_to_html(csv_align_colon_dash, strlen(csv_align_colon_dash), &opts);
975
- assert_contains(html, "<table>", "CSV table colon-dash alignment: table element");
976
- assert_contains(html, "A", "CSV table colon-dash alignment: header A");
977
- assert_contains(html, "x", "CSV table colon-dash alignment: data x");
978
- apex_free_string(html);
979
-
980
- /* ```table fence with no explicit alignment row: should also be headless */
981
- const char *csv_no_align =
982
- "```table\n"
983
- "r1c1,r1c2,r1c3\n"
984
- "r2c1,r2c2,r2c3\n"
985
- "```\n";
986
- html = apex_markdown_to_html(csv_no_align, strlen(csv_no_align), &opts);
987
- assert_contains(html, "<table>", "CSV table no-align: table element");
988
- assert_contains(html, "r1c1", "CSV table no-align: first row content present");
989
- assert_contains(html, "r2c1", "CSV table no-align: second row content present");
990
- apex_free_string(html);
991
-
992
- /* ```table fence with TSV data (real tabs) */
993
- const char *tsv_table =
994
- "```table\n"
995
- "col1\tcol2\tcol3\n"
996
- "val1\tval2\tval3\n"
997
- "```\n";
998
- html = apex_markdown_to_html(tsv_table, strlen(tsv_table), &opts);
999
- assert_contains(html, "<table>", "TSV table fence: table element");
1000
- assert_contains(html, "col1", "TSV table fence: header col1 text");
1001
- assert_contains(html, "col2", "TSV table fence: header col2 text");
1002
- assert_contains(html, "col3", "TSV table fence: header col3 text");
1003
- assert_contains(html, "val1", "TSV table fence: first data value");
1004
- apex_free_string(html);
1005
-
1006
- /* ```table fence with no delimiter: should remain a code block */
1007
- const char *no_delim =
1008
- "```table\n"
1009
- "this has no delimiters\n"
1010
- "on the second line\n"
1011
- "```\n";
1012
- html = apex_markdown_to_html(no_delim, strlen(no_delim), &opts);
1013
- assert_contains(html, "<pre lang=\"table\"><code>", "No-delim table fence: rendered as code block");
1014
- assert_contains(html, "this has no delimiters", "No-delim table fence: content preserved");
1015
- apex_free_string(html);
1016
-
1017
- /* <!--TABLE--> with CSV data */
1018
- const char *csv_marker =
1019
- "<!--TABLE-->\n"
1020
- "one,two,three\n"
1021
- "four,five,six\n"
1022
- "\n";
1023
- html = apex_markdown_to_html(csv_marker, strlen(csv_marker), &opts);
1024
- assert_contains(html, "<table>", "CSV TABLE marker: table element");
1025
- assert_contains(html, "one", "CSV TABLE marker: header text");
1026
- assert_contains(html, "four", "CSV TABLE marker: data value");
1027
- apex_free_string(html);
1028
-
1029
- /* <!--TABLE--> with TSV data (real tabs) */
1030
- const char *tsv_marker =
1031
- "<!--TABLE-->\n"
1032
- "alpha\tbeta\tgamma\n"
1033
- "delta\tepsilon\tzeta\n"
1034
- "\n";
1035
- html = apex_markdown_to_html(tsv_marker, strlen(tsv_marker), &opts);
1036
- assert_contains(html, "<table>", "TSV TABLE marker: table element");
1037
- assert_contains(html, "alpha", "TSV TABLE marker: header text");
1038
- assert_contains(html, "delta", "TSV TABLE marker: data value");
1039
- apex_free_string(html);
1040
-
1041
- /* <!--TABLE--> with no following data: comment should be preserved */
1042
- const char *empty_marker =
1043
- "Before\n\n"
1044
- "<!--TABLE-->\n"
1045
- "\n"
1046
- "After\n";
1047
- html = apex_markdown_to_html(empty_marker, strlen(empty_marker), &opts);
1048
- assert_contains(html, "Before", "Empty TABLE marker: before text preserved");
1049
- assert_contains(html, "<!--TABLE-->", "Empty TABLE marker: comment preserved");
1050
- assert_contains(html, "After", "Empty TABLE marker: after text preserved");
1051
- apex_free_string(html);
1052
-
1053
- bool had_failures = suite_end(suite_failures);
1054
- print_suite_title("Inline Tables Tests", had_failures, false);
1055
- }
1056
-
1057
- void test_grid_tables(void) {
1058
- int suite_failures = suite_start();
1059
- print_suite_title("Grid Tables Tests", false, true);
1060
-
1061
- apex_options opts = apex_options_default();
1062
- opts.enable_tables = true;
1063
- opts.enable_grid_tables = true;
1064
- opts.relaxed_tables = false;
1065
- char *html;
1066
-
1067
- /* Test basic grid table */
1068
- const char *basic_grid = "+---+---+\n"
1069
- "| H1 | H2 |\n"
1070
- "+===+===+\n"
1071
- "| C1 | C2 |\n"
1072
- "+---+---+";
1073
- html = apex_markdown_to_html(basic_grid, strlen(basic_grid), &opts);
1074
- assert_contains(html, "<table", "Basic grid table renders");
1075
- assert_contains(html, "<th>H1</th>", "Grid table header");
1076
- assert_contains(html, "<td>C1</td>", "Grid table cell");
1077
- apex_free_string(html);
1078
-
1079
- /* Test grid table with header separator */
1080
- const char *header_sep_grid = "+---+---+\n"
1081
- "| H1 | H2 |\n"
1082
- "+===+===+\n"
1083
- "| C1 | C2 |\n"
1084
- "+---+---+";
1085
- html = apex_markdown_to_html(header_sep_grid, strlen(header_sep_grid), &opts);
1086
- assert_contains(html, "<table", "Grid table with header separator renders");
1087
- assert_contains(html, "<th>H1</th>", "Header separator table has header");
1088
- apex_free_string(html);
1089
-
1090
- /* Test grid table with alignment */
1091
- const char *aligned_grid = "+:---+---+---:+\n"
1092
- "| C | L | R |\n"
1093
- "+===+===+===+\n"
1094
- "| A | B | C |\n"
1095
- "+---+---+---+";
1096
- html = apex_markdown_to_html(aligned_grid, strlen(aligned_grid), &opts);
1097
- assert_contains(html, "<table", "Aligned grid table renders");
1098
- apex_free_string(html);
1099
-
1100
- /* Test grid table with footer separator */
1101
- const char *footer_grid = "+---+---+\n"
1102
- "| H1 | H2 |\n"
1103
- "+---+---+\n"
1104
- "| C1 | C2 |\n"
1105
- "+===+===+\n"
1106
- "| F1 | F2 |\n"
1107
- "+---+---+";
1108
- html = apex_markdown_to_html(footer_grid, strlen(footer_grid), &opts);
1109
- assert_contains(html, "<table", "Grid table with footer renders");
1110
- apex_free_string(html);
1111
-
1112
- /* Test multi-line cells in grid table */
1113
- const char *multiline_grid = "+---+---+\n"
1114
- "| H1 | H2 |\n"
1115
- "+===+===+\n"
1116
- "| Line 1 | Cell 2 |\n"
1117
- "| Line 2 | |\n"
1118
- "+---+---+";
1119
- html = apex_markdown_to_html(multiline_grid, strlen(multiline_grid), &opts);
1120
- assert_contains(html, "<table", "Multi-line grid table renders");
1121
- assert_contains(html, "Line 1", "Multi-line cell content preserved");
1122
- assert_contains(html, "Line 2", "Multi-line cell second line preserved");
1123
- apex_free_string(html);
1124
-
1125
- /* Test grid table with caption (before) */
1126
- const char *caption_before = "[Grid Table Caption]\n\n"
1127
- "+---+---+\n"
1128
- "| H1 | H2 |\n"
1129
- "+===+===+\n"
1130
- "| C1 | C2 |\n"
1131
- "+---+---+";
1132
- html = apex_markdown_to_html(caption_before, strlen(caption_before), &opts);
1133
- assert_contains(html, "<table", "Grid table with caption before renders");
1134
- assert_contains(html, "<figure", "Grid table with caption wrapped in figure");
1135
- assert_contains(html, "Grid Table Caption", "Caption text present");
1136
- apex_free_string(html);
1137
-
1138
- /* Test grid table with caption (after) */
1139
- const char *caption_after = "+---+---+\n"
1140
- "| H1 | H2 |\n"
1141
- "+===+===+\n"
1142
- "| C1 | C2 |\n"
1143
- "+---+---+\n\n"
1144
- "[Grid Table Caption After]";
1145
- html = apex_markdown_to_html(caption_after, strlen(caption_after), &opts);
1146
- assert_contains(html, "<table", "Grid table with caption after renders");
1147
- assert_contains(html, "Grid Table Caption After", "Caption text after present");
1148
- apex_free_string(html);
1149
-
1150
- /* Test grid table in code block (should not be parsed) */
1151
- const char *code_block_grid = "```\n"
1152
- "+---+---+\n"
1153
- "| H1 | H2 |\n"
1154
- "+===+===+\n"
1155
- "| C1 | C2 |\n"
1156
- "+---+---+\n"
1157
- "```";
1158
- html = apex_markdown_to_html(code_block_grid, strlen(code_block_grid), &opts);
1159
- assert_not_contains(html, "<table", "Grid table in code block not parsed");
1160
- assert_contains(html, "<code", "Code block preserved");
1161
- apex_free_string(html);
1162
-
1163
- /* Test mixed grid and pipe tables */
1164
- const char *mixed_tables = "+---+---+\n"
1165
- "| G1 | G2 |\n"
1166
- "+===+===+\n"
1167
- "| GC1 | GC2 |\n"
1168
- "+---+---+\n\n"
1169
- "| P1 | P2 |\n"
1170
- "|----|----|\n"
1171
- "| PC1 | PC2 |";
1172
- html = apex_markdown_to_html(mixed_tables, strlen(mixed_tables), &opts);
1173
- assert_contains(html, "<table", "Mixed tables render");
1174
- assert_contains(html, "G1", "Grid table content present");
1175
- assert_contains(html, "P1", "Pipe table content present");
1176
- apex_free_string(html);
1177
-
1178
- /* Test grid table disabled */
1179
- opts.enable_grid_tables = false;
1180
- html = apex_markdown_to_html(basic_grid, strlen(basic_grid), &opts);
1181
- apex_free_string(html);
1182
-
1183
- /* Complex colspan row spanning full table width (no closing table separator) */
1184
- opts.enable_grid_tables = true;
1185
- opts.enable_tables = true;
1186
- const char *colspan_grid = "+---+---+\n"
1187
- "| H1 | H2 |\n"
1188
- "+===+===+\n"
1189
- "| C1 | C2 |\n"
1190
- "+---+---+\n"
1191
- "| Spans both columns here |\n";
1192
- html = apex_markdown_to_html(colspan_grid, strlen(colspan_grid), &opts);
1193
- assert_contains(html, "colspan=\"2\"", "Colspan row spans both columns");
1194
- assert_contains(html, "Spans both columns", "Colspan cell content preserved");
1195
- apex_free_string(html);
1196
-
1197
- /* Nested grid inside colspan cell stays in one cell */
1198
- const char *nested_in_colspan = "+---+---+\n"
1199
- "| A | B |\n"
1200
- "+===+===+\n"
1201
- "| Wide cell |\n"
1202
- "+---+---+---+\n"
1203
- "| n1 | n2 | n3 |\n"
1204
- "+---+---+---+";
1205
- html = apex_markdown_to_html(nested_in_colspan, strlen(nested_in_colspan), &opts);
1206
- assert_contains(html, "colspan=\"2\"", "Nested grid parent has colspan");
1207
- assert_contains(html, "Wide cell", "Wide cell text preserved");
1208
- assert_not_contains(html, "<tr>\n<td>n1</td>\n<td>n2</td>", "Nested grid not separate top-level row");
1209
- apex_free_string(html);
1210
-
1211
- /* Fixture table 1: colspan + nested grid stays inside the table, not a stray paragraph */
1212
- const char *fixture_colspan_nested = "+-------------------+-------------------+\n"
1213
- "| Grid Tables | Are Beautiful |\n"
1214
- "+===================+===================+\n"
1215
- "| Easy to read | In code and docs |\n"
1216
- "+-------------------+-------------------+\n"
1217
- "| Exceptionally flexible and powerful |\n"
1218
- "+-------+-------+-------+-------+-------+\n"
1219
- "| Col 1 | Col 2 | Col 3 | Col 4 | Col 5 |\n"
1220
- "+-------+-------+-------+-------+-------+\n";
1221
- html = apex_markdown_to_html(fixture_colspan_nested, strlen(fixture_colspan_nested), &opts);
1222
- assert_contains(html, "colspan=\"2\"", "Fixture colspan row in table");
1223
- assert_contains(html, "Exceptionally flexible and powerful", "Fixture colspan text in output");
1224
- assert_not_contains(html, "</table>\n<p>|", "Colspan row not leaked as paragraph after table");
1225
- assert_contains(html, "Col 1", "Nested grid Col 1 inside colspan cell");
1226
- assert_contains(html, "Col 5", "Nested grid Col 5 inside colspan cell");
1227
- apex_free_string(html);
1228
-
1229
- /* Partial separator table (fixture table 2 pattern) */
1230
- const char *partial_grid = "+---------------------+----------+\n"
1231
- "| Property | Earth |\n"
1232
- "+=============+=======+==========+\n"
1233
- "| | min | -89.2 °C |\n"
1234
- "| Temperature +-------+----------+\n"
1235
- "| 1961-1990 | mean | 14 °C |\n"
1236
- "| +-------+----------+\n"
1237
- "| | min | 56.7 °C |\n"
1238
- "+-------------+-------+----------+\n";
1239
- html = apex_markdown_to_html(partial_grid, strlen(partial_grid), &opts);
1240
- assert_contains(html, "colspan=\"2\"", "Partial table Property spans two columns");
1241
- assert_contains(html, "rowspan=\"3\"", "Partial table Temperature rowspan");
1242
- assert_contains(html, "14 °C", "Partial table mean temperature");
1243
- apex_free_string(html);
1244
-
1245
- /* Multiline list cells */
1246
- const char *list_cells = "+---+---+---+\n"
1247
- "| F | P | Notes |\n"
1248
- "+===+===+===+\n"
1249
- "| Ban | $1 | - one |\n"
1250
- "| | | - two |\n"
1251
- "+---+---+---+";
1252
- html = apex_markdown_to_html(list_cells, strlen(list_cells), &opts);
1253
- assert_contains(html, "<ul>", "List cell renders as ul");
1254
- assert_contains(html, "<li>one</li>", "List item one in cell");
1255
- assert_contains(html, "<li>two</li>", "List item two in cell");
1256
- assert_contains(html, "<table", "List cells table renders");
1257
- apex_free_string(html);
1258
-
1259
- /* Plus-prefixed prose lines are not mistaken for grid tables */
1260
- const char *plus_prose = "+ Item one\n+ Item two\n\nParagraph after.";
1261
- html = apex_markdown_to_html(plus_prose, strlen(plus_prose), &opts);
1262
- assert_contains(html, "Item one", "Plus prose lines preserved as list items");
1263
- assert_contains(html, "Paragraph after", "Text after plus lines preserved");
1264
- assert_not_contains(html, "<table", "Plus prose is not converted to a table");
1265
- apex_free_string(html);
1266
-
1267
- /* Block with +---+ lines but no valid grid content is preserved on failure */
1268
- const char *invalid_grid = "+---+\nThis line has no pipes\n+---+";
1269
- html = apex_markdown_to_html(invalid_grid, strlen(invalid_grid), &opts);
1270
- assert_contains(html, "This line has no pipes", "Invalid grid block content preserved");
1271
- apex_free_string(html);
1272
-
1273
- /* Grid tables disabled by default in unified mode */
1274
- apex_options unified_opts = apex_options_for_mode(APEX_MODE_UNIFIED);
1275
- html = apex_markdown_to_html(basic_grid, strlen(basic_grid), &unified_opts);
1276
- assert_not_contains(html, "<th>H1</th>", "Grid tables off by default in unified mode");
1277
- apex_free_string(html);
1278
-
1279
- /* Pandoc-style simple grid (manual example pattern) */
1280
- const char *pandoc_simple = "+---------------+---------------+\n"
1281
- "| Fruit | Price |\n"
1282
- "+:==============+==============:+\n"
1283
- "| Bananas | $1.34 |\n"
1284
- "| Oranges | $2.10 |\n"
1285
- "+---------------+---------------+\n";
1286
- html = apex_markdown_to_html(pandoc_simple, strlen(pandoc_simple), &opts);
1287
- assert_contains(html, "Bananas", "Pandoc-style aligned grid renders");
1288
- assert_contains(html, "$1.34", "Pandoc-style grid cell content");
1289
- assert_contains(html, "<table", "Pandoc-style grid produces table");
1290
- apex_free_string(html);
1291
-
1292
- bool had_failures = suite_end(suite_failures);
1293
- print_suite_title("Grid Tables Tests", had_failures, false);
1294
- }
1295
-
1296
- /**
1297
- * Test advanced footnotes
1298
- */