Repository navigation
fix(md): drop whitespace-only lines before code block content - #4543
Merged
DanielNg0729 merged 1 commit intoOct 4, 2026
Merged
DanielNg0729 merged 1 commit into
DanielNg0729 merged 1 commit into
Conversation
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @ankit2235, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
PeterStaar-IBM
self-requested a review
October 4, 2026 06:21
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
DanielNg0729
approved these changes
Oct 4, 2026
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.
Follow-up to #4487. The Markdown backend trimmed code block content with
lstrip("\n").rstrip(), so a first line holding only spaces survived and the code item started with a line of whitespace (' \n x = 1').This uses the same trimming as the LaTeX backend after #4502 (suggested in review by @DanielNg0729): leading lines that hold only whitespace are dropped, and the first code line keeps its indentation.
The existing
test_code_block_keeps_first_line_indentationgets a fourth block with a spaces-only first line. It fails onmainand passes with this change; the other Markdown tests, including the groundtruth comparison, pass unchanged.Issue resolved by this Pull Request:
Resolves #4541
Checklist: