Skip to content

fix(markdown): keep bracket math and div fences whole - #510

Merged
HaoZeke merged 15 commits into
mainfrom
fix/markdown-math-div
Sep 26, 2026
Merged

HaoZeke merged 15 commits into
mainfrom
fix/markdown-math-div

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Markdown \[ / \] display math was reflowed as prose.

A pandoc ::: fence was reflowed as prose, and a fence could be read as a definition marker.

Bracket math now stays structure, the same way $$ does. An unclosed \[ stays prose.

The fence stays structure. Prose inside the div still splits. A sentence does not cross the fence.

HaoZeke and others added 15 commits September 26, 2026 04:34
\[ ... \] is display math, same as $$, so a sentence inside it stays
one structure block. A pandoc ::: fence stays structure while prose
inside the div still reflows, and a sentence cannot cross the fence.
An opener without \] stays prose. The following paragraph still
reflows. The open bracket is not a sentence boundary by itself.
A blank line ends the unclosed opener. The next paragraph stays
prose and still splits.
A line of three or more colons matches the definition-list colon
with no spaces after it, so the paragraph above becomes a title.
A pandoc fence is not that marker.
A later \] is not a closer once a blank line has ended the opener.
The middle paragraph stays prose and still splits. A \[ ... \] block
with no blank line between stays structure.
Markdown reuses the LaTeX non-prose and code-environment names, so
subequations, dmath, multlined, loglogaxis, tikzpicture*, and matrix*
are not sentence-split. Prose outside the body still splits.
The blank-line bracket search stays, and dmath* stays on the
non-prose list next to the markdown environment names.
fix(markdown): keep LaTeX non-prose environments whole
The axis names from main stay on the non-prose list next to the
markdown environment names.
@HaoZeke
HaoZeke merged commit 27de107 into main Sep 26, 2026
24 checks passed
@HaoZeke
HaoZeke deleted the fix/markdown-math-div branch September 26, 2026 11:55
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.

1 participant