Fix code block whitespace handling in Markdown#155040
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Apr 10, 2026
Merged
Fix code block whitespace handling in Markdown#155040rust-bors[bot] merged 2 commits intorust-lang:mainfrom
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
13 tasks
teor2345
approved these changes
Apr 10, 2026
JohnTitor
approved these changes
Apr 10, 2026
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 10, 2026
… r=JohnTitor Fix code block whitespace handling in Markdown ### Fix Markdown code block closing whitespace handling Previously, the parser incorrectly accepted closing backticks followed by extra text and rejected lines where only spaces appeared after closing backticks. This did not match expected Markdown behavior. Now, the parser correctly ends a code block only when line after the code ends with spaces or nothing. Lines where extra text appears after the closing backticks are treated as part of the code block. Includes tests for both correct and incorrect cases. ### Related issue This PR addresses the Outreachy issue: [Markdown whitespace bug in Rust Compiler](rustfoundation/interop-initiative#53)
This was referenced Apr 10, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 10, 2026
…uwer Rollup of 8 pull requests Successful merges: - #155047 (Always exhaustively match on typing mode) - #155080 (Simplify `try_load_from_disk_fn`.) - #152384 (Restrict EII declarations to functions at lowering time) - #153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures]) - #154369 (Fix `pattern_from_macro_note` for bit-or expr) - #155027 ( Rename some more of our internal `#[rustc_*]` TEST attributes) - #155031 (delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition) - #155040 (Fix code block whitespace handling in Markdown)
rust-timer
added a commit
that referenced
this pull request
Apr 10, 2026
Rollup merge of #155040 - yalagadapavankumar:fix-whitespace, r=JohnTitor Fix code block whitespace handling in Markdown ### Fix Markdown code block closing whitespace handling Previously, the parser incorrectly accepted closing backticks followed by extra text and rejected lines where only spaces appeared after closing backticks. This did not match expected Markdown behavior. Now, the parser correctly ends a code block only when line after the code ends with spaces or nothing. Lines where extra text appears after the closing backticks are treated as part of the code block. Includes tests for both correct and incorrect cases. ### Related issue This PR addresses the Outreachy issue: [Markdown whitespace bug in Rust Compiler](rustfoundation/interop-initiative#53)
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Apr 13, 2026
…uwer Rollup of 8 pull requests Successful merges: - rust-lang/rust#155047 (Always exhaustively match on typing mode) - rust-lang/rust#155080 (Simplify `try_load_from_disk_fn`.) - rust-lang/rust#152384 (Restrict EII declarations to functions at lowering time) - rust-lang/rust#153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures]) - rust-lang/rust#154369 (Fix `pattern_from_macro_note` for bit-or expr) - rust-lang/rust#155027 ( Rename some more of our internal `#[rustc_*]` TEST attributes) - rust-lang/rust#155031 (delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition) - rust-lang/rust#155040 (Fix code block whitespace handling in Markdown)
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.
Fix Markdown code block closing whitespace handling
Previously, the parser incorrectly accepted closing backticks followed by extra text and rejected lines where only spaces appeared after closing backticks. This did not match expected Markdown behavior.
Now, the parser correctly ends a code block only when line after the code ends with spaces or nothing. Lines where extra text appears after the closing backticks are treated as part of the code block.
Includes tests for both correct and incorrect cases.
Related issue
This PR addresses the Outreachy issue: Markdown whitespace bug in Rust Compiler