Skip to content

fix(heading): defer nested Table, Hr, and Latex_env blocks in Markdown headings - #157

Merged
tiensonqin merged 1 commit into
masterfrom
fix/md-heading-nested-blocks
Nov 18, 2026
Merged

tiensonqin merged 1 commit into
masterfrom
fix/md-heading-nested-blocks

Conversation

@tiensonqin

Copy link
Copy Markdown
Collaborator

Summary

When specializing Markdown heading title guards (md_title_guard, title_aux_p, and try_parse_md_line), three block parsers present in the original Heading choice list were omitted:

  • Table.parse (- | Header A | Header B |\n | A1 | B1 |\n | A2 | B2 | consumed row 1 into the heading title and promoted A1 | B1 to <thead>, breaking logseq/og's e2e-tests/shui/table.spec.js).
  • Hr.parse (- ---, - ***, - ___ consumed the rule as plain heading title text instead of Horizontal_Rule).
  • Latex_env.parse (- \begin{equation}...\end{equation} only checked Block.parse, consuming \begin{equation} into the heading title instead of Latex_Environment).

Restore all three guards and add regression tests in test/test_markdown.ml.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tiensonqin
tiensonqin force-pushed the fix/md-heading-nested-blocks branch from e2de0e9 to 3e07a4f Compare November 18, 2026 10:49
@tiensonqin
tiensonqin merged commit fae8508 into master Nov 18, 2026
5 of 6 checks passed
@tiensonqin
tiensonqin deleted the fix/md-heading-nested-blocks branch November 18, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants