Repository navigation
fix(help): render a code block whose fence is never closed - #4183
Merged
Merged
Conversation
`render_markdown` collected fenced lines and rendered them only on the closing fence, so an unterminated fence dropped everything from the fence to the end of the input. Help pages are authored and balanced, but the picker's `pr` and comments panes render arbitrary forge markdown through the same function, where a PR body or comment that opens a fence and never closes it lost the rest of its text silently. Extract the block rendering into `render_code_block` and call it both at the closing fence and once more at end of input when a block is still open, so an unterminated block renders exactly as the same lines would with a closing fence.
Merged
max-sixty
added a commit
that referenced
this pull request
Sep 20, 2026
0.79.0 was prepared and merged in #4181 but never tagged, so it never shipped. Cargo.toml and Cargo.lock already carry the version, so this reuses it and folds the thirteen commits that landed since into the same changelog section. New entries cover the worktree-side rename fixes (#4190, #4191), the per-project unknown-field warning (#4123), and the unterminated code fence in the picker's preview (#4183, combined with #4178's column fix). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 task
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.
An unterminated code fence in a PR description or comment silently swallowed
the rest of the body in the switch picker's preview panes.
md_help::render_markdowncollects fenced lines and renders them when it seesthe closing fence. With no closing fence, the loop ended with the lines still
in the buffer and nothing appended — so everything from the opening fence to
the end of the input disappeared. Help pages are authored and balanced, so this
never showed there; the
prand comments panes reach the same function throughrender_markdown_flushwith markdown the forge hands us verbatim(
picker::pr_pane::description,picker::pr_pane::markdown_in_gutter).The block rendering moves into
render_code_block, called both at the closingfence and once at end of input when a block is still open. An unterminated
block now renders exactly as the same lines would with a closing fence — same
dim, same gutter, same language handling — so nothing else about the output
moves.
Two regression tests, one per render context (flush for the panes, gutter for
help). Both fail on
main: the rendered output stops atbeforeand thefenced lines are gone.
Verification
cargo test --bins md_help::tests::test_unterminated— passes with the fix,fails with the end-of-input flush reverted.
cargo test --bins— one unrelated failure,commands::step::promote::tests::test_copy_and_remove_drops_a_non_regular_file,which binds a Unix socket; the tend sandbox denies
socket(AF_UNIX, …), soit fails there regardless of this change and passes in CI.
cargo test --test integration -- test_help test_docs_are_in_sync— 57passed, so no rendered help or doc-sync snapshot moves.
cargo fmt --check,cargo clippy --bins --all-targets— clean.