Skip to content

fix: preserve line breaks in expanded thinking content#456

Open
hobostay wants to merge 1 commit intoCodebuffAI:mainfrom
hobostay:fix/thinking-markdown-line-breaks
Open

fix: preserve line breaks in expanded thinking content#456
hobostay wants to merge 1 commit intoCodebuffAI:mainfrom
hobostay:fix/thinking-markdown-line-breaks

Conversation

@hobostay
Copy link

@hobostay hobostay commented Mar 5, 2026

Fixes #419

The thinking component was normalizing content to a single line even in expanded mode, causing multi-line markdown content to be collapsed into a single unreadable line.

Changes:

  • Added expandedContent variable that preserves line breaks
  • Use expandedContent in expanded mode instead of raw content
  • Clean up excessive consecutive newlines while preserving paragraph breaks

This ensures proper markdown rendering in the thinking section when expanded.

Fixes CodebuffAI#419

The thinking component was normalizing content to a single line even
in expanded mode, causing multi-line markdown content (headers,
lists, flow diagrams) to be collapsed into a single unreadable line.

Changes:
- Added  variable that preserves line breaks
- Use  in expanded mode instead of raw
- Clean up excessive consecutive newlines while preserving paragraph breaks

This ensures proper markdown rendering in the thinking section when
expanded, while maintaining the compact single-line preview.
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.

Markdown rendering broken in Thinking section - content collapsed into single line

1 participant