Skip to content

Synchronize opening and closing delimiter validation for inline math ($...$)#11348

Merged
jgm merged 2 commits intojgm:mainfrom
benniekiss:inline-math-parsing
Dec 14, 2025
Merged

Synchronize opening and closing delimiter validation for inline math ($...$)#11348
jgm merged 2 commits intojgm:mainfrom
benniekiss:inline-math-parsing

Conversation

@benniekiss
Copy link
Contributor

This PR adds a check in the inline math parser to ensure blanklines are not followed by a closing delimiter character.

This synchronizes the parsing of opening and closing delimiters, where previously, an opening delimiter could not be followed by a newline, while a closing delimiter could be preceded by one.

The following block is now invalid inline math:

$my inline math
$

Closes #11311

@jgm
Copy link
Owner

jgm commented Dec 13, 2025

Looks good! Maybe add a simple command test? In test/command/11348.md; see the other tests for the format.

@benniekiss
Copy link
Contributor Author

Done! Tested on my end as well.

@jgm jgm merged commit 6f9a98a into jgm:main Dec 14, 2025
7 of 10 checks passed
jgm pushed a commit that referenced this pull request Dec 14, 2025
Do not allow blank lines before closing `$` delimiter.
This brings the parser in line with the documentation.

Closes #11311.
@jgm
Copy link
Owner

jgm commented Dec 14, 2025

Thanks!

@benniekiss benniekiss deleted the inline-math-parsing branch December 14, 2025 15:51
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.

Inconsistent handling of spacing with inline math delimiters ($)

2 participants