Fix MD rendering for non-streamed bodies#667
Merged
Merged
Conversation
Fix: Markdown rendering is skipped for non-streamed bodies (e.g. plan blocks) `text-property-any` matched `invisible t` on trailing whitespace set by `agent-shell-ui--apply-trailing-whitespace-invisible`, causing the collapsed-body guard to skip markdown rendering. Check only the first character instead — a truly collapsed body has `invisible t` on every char, while a visible body only has it on trailing newlines.
2e2e10a to
5209859
Compare
Contributor
Author
|
I've updated this to merge with latest. |
xenodium
added a commit
that referenced
this pull request
Jun 30, 2026
Owner
|
FYI small tweak 0c54d5b |
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 rendering is skipped for non-streamed bodies (e.g. plan blocks)
This makes tables, for example, look terrible.
text-property-anymatchedinvisible ton trailing whitespace set byagent-shell-ui--apply-trailing-whitespace-invisible, causing the collapsed-body guard to skip markdown rendering. Check only the first character instead a truly collapsed body hasinvisible ton every char, while a visible body only has it on trailing newlines.Frankly, I'm not completely confident in this change. I was having a problem where tables included in "Proposed plan" results from Claude were not being rendered. Raw Markdown content was being shown, and that was nearly impossible to read. Other tables rendered just fine. This is the best fix I was able to figure out (with Claude's help, I will admit). Please let me know what you think. If this isn't the right way to fix this problem, I'd be grateful for hints about a better approach.
Thanks.
Thank you for contributing to agent-shell!
Checklist
M-x checkdocandM-x byte-compile-file.