🐛 FIX: dollarmath same-line close absorbs trailing list content#149
Open
KyleKing wants to merge 3 commits into
Open
🐛 FIX: dollarmath same-line close absorbs trailing list content#149KyleKing wants to merge 3 commits into
KyleKing wants to merge 3 commits into
Conversation
chrisjsewell
left a comment
Member
There was a problem hiding this comment.
Checked this out and reproduced #147 before/after. The fix resolves it: the issue's 1. $$a$$ / 1. $$b$$ trailing / $$c$$ input no longer swallows the following list item(s) into the first math token — the ambiguous same-line-close-with-trailing case now returns False and falls through to inline parsing. All 515 tests pass.
Coverage is solid:
test_block_func_ambiguous_trailing_contentparametrizes bothallow_labelsbranches (theelif allow_labels:path and theelsepath both got the guard), which is exactly the split that matters.- The
dollar_math.mdfixtures exercise it end-to-end underdouble_inline=True. - CHANGELOG updated.
I confirmed labels still work ($$a=1$$ (lbl) → labeled block) and that $$a=1$$ (lbl) x — a label followed by trailing junk — is now correctly rejected rather than greedily scanning ahead.
One edge-case note inline about multi-line blocks whose opening line contains an internal $$, but it's consistent with the issue's intent. Looks good to me.
Generated by Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #147
A same-line close followed by trailing content that wasn't a label suffix (e.g.
$$b$$ trailing) wasn't recognized as closed, so the rule fell through to its multi-line scan and silently swallowed every following line, including subsequent list items, up to the next$$anywhere later in the document:This ambiguous case (closing marker present, but not at end of line and not a label) is now rejected outright, letting the line fall through to normal inline parsing instead.