File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const Thinking = memo(
3939 }
4040
4141 const width = Math . max ( 10 , availableWidth ?? contentMaxWidth )
42- // Normalize content to single line for consistent preview
42+ // Normalize content to single line for consistent preview (but preserve in expanded mode)
4343 const normalizedContent = content . replace ( / \n + / g, ' ' ) . trim ( )
4444 // Account for "..." prefix (3 chars) when calculating line widths
4545 const effectiveWidth = width - 3
@@ -48,6 +48,8 @@ export const Thinking = memo(
4848 effectiveWidth ,
4949 PREVIEW_LINE_COUNT ,
5050 )
51+ // In expanded mode, preserve original line breaks for proper markdown rendering
52+ const expandedContent = content . replace ( / \n \n + / g, '\n\n' ) . trim ( )
5153
5254 const showFull = thinkingCollapseState === 'expanded'
5355 const showPreview = thinkingCollapseState === 'preview' && lines . length > 0
@@ -94,7 +96,7 @@ export const Thinking = memo(
9496 } }
9597 attributes = { TextAttributes . ITALIC }
9698 >
97- { content }
99+ { expandedContent }
98100 </ text >
99101 </ box >
100102 ) }
You can’t perform that action at this time.
0 commit comments