Skip to content

Fix MD rendering for non-streamed bodies#667

Merged
xenodium merged 1 commit into
xenodium:mainfrom
arthurgleckler:table-fix
Jun 30, 2026
Merged

Fix MD rendering for non-streamed bodies#667
xenodium merged 1 commit into
xenodium:mainfrom
arthurgleckler:table-fix

Conversation

@arthurgleckler

@arthurgleckler arthurgleckler commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fix: Markdown rendering is skipped for non-streamed bodies (e.g. plan blocks)

This makes tables, for example, look terrible.

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.

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

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • [x ] I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • [N/A] I've filed a feature request/discussion for a new feature.
  • [N/A] I'm making visual changes, so I'm including screenshots so you can view and discuss.
  • [N/A] I've added tests where applicable.
  • [N/A] I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

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.
@arthurgleckler

Copy link
Copy Markdown
Contributor Author

I've updated this to merge with latest.

@xenodium xenodium left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@xenodium xenodium merged commit 8adc58e into xenodium:main Jun 30, 2026
2 checks passed
@xenodium

Copy link
Copy Markdown
Owner

FYI small tweak 0c54d5b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants