Repository navigation
Conversation
… on continuation lines A block quote marker may be indented by at most 3 spaces. The first line already checks this with is_code_block, but the loop over the following lines did not, so `> a\n > b` dropped the second `>` instead of keeping it as lazy paragraph continuation text (as commonmark.js does). Fixes executablebooks#473
This branch has not been deployed
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 #473.
A block quote marker can be indented by at most 3 spaces.
blockquote()checks this for the first line (state.is_code_block(startLine)), but the loop over the following lines only checkedisOutdented. So a continuation line like> bwas read as a marker and its>was dropped:The fix adds
not state.is_code_block(nextLine)to the marker check, so such a line goes on to the lazy continuation path. Usingis_code_blockkeeps the existing behaviour when thecoderule is disabled (then 4+ space markers are allowed, as for the first line).I found this by running markdown-it-py and commonmark.js 0.31.2 on ~30,000 generated inputs. markdown-it 15.0.3 has the same gap.
Tests: 4 new cases in
tests/test_port/fixtures/issue-fixes.md(top level, inside a list item, nested block quote, and a 3-space guard). The first 3 fail without the change.pytest tests: 1194 passed; pre-commit (ruff, ruff-format, mypy) clean. On the same 30,000 inputs, 4 more now match commonmark.js and none newly differ.