Fix: block quotes not interrupting paragraphs#53
Merged
Conversation
Fixes #43. Per GFM spec §5.1, block quotes can interrupt paragraphs. Previously, handle_in_paragraph() did not check for blockquote markers, so lines like '> bar' were treated as literal text within the paragraph. Changes: - Added parse_blockquote_marker() check in handle_in_paragraph() - Added conformance test for blockquote interrupting paragraphs
llimllib
added a commit
that referenced
this pull request
Mar 14, 2026
Fixes #44. Per GFM spec §5.3, lists can interrupt paragraphs. Previously, `handle_in_paragraph()` did not check for list items, so lines like `- bar` were treated as literal text within the paragraph. ## Changes ### `src/lib.rs` Added a `parse_list_item()` check in `handle_in_paragraph()`, after the blockquote marker check and before the table delimiter row check. When a list item is detected while in a paragraph: 1. The current paragraph is emitted 2. The parser transitions to `InList` state 3. The list starts buffering items Per the GFM spec §5.3, ordered lists can only interrupt paragraphs if they start with `1`. Ordered lists starting with other numbers (like `14.`) are treated as continuation paragraph text. This follows the same pattern as the blockquote interrupt (#53), ATX heading interrupt (#52), and thematic break interrupt (#51). ### `tests/fixtures/blocks/list_interrupts_paragraph.toml` Added a conformance test covering: - Unordered list interrupting a paragraph (GFM spec Example 283) - Ordered list starting with 1 interrupting a paragraph - Ordered list NOT starting with 1 cannot interrupt a paragraph (GFM spec Example 284) ## Session transcript [Claude Code session transcript](https://github.com/llimllib/mdriver/blob/list-interrupt/transcripts/54-fix-list-interrupt.html)
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 #43. Per GFM spec §5.1, block quotes can interrupt paragraphs. Previously,
handle_in_paragraph()did not check for blockquote markers, so lines like> barwere treated as literal text within the paragraph.Changes
src/lib.rsAdded a
parse_blockquote_marker()check inhandle_in_paragraph(), after the code fence check. When a blockquote marker (>) is detected while in a paragraph:InBlockquotestateThis follows the same pattern as the ATX heading interrupt (#52) and thematic break interrupt (#51).
tests/fixtures/blocks/blockquote_interrupts_paragraph.tomlAdded a conformance test covering:
Session transcript
Claude Code session transcript