@@ -101,16 +101,17 @@ export class MarkdownStreamRenderer {
101101 this . md . use ( terminal , {
102102 style : {
103103 // Add spacing after headings
104- heading : ( text : string ) => `\n${ text } \n` ,
104+ heading : ( text : string ) => `\n${ text || '' } \n` ,
105105 // Add spacing around paragraphs
106- paragraph : ( text : string ) => `${ text } \n` ,
106+ paragraph : ( text : string ) => `${ text || '' } \n` ,
107107 // Customize list items with Unicode bullet points for unordered lists
108- listitem : ( text : string ) => ` • ${ text } ` ,
108+ listitem : ( text : string ) => ` • ${ text || '' } ` ,
109109 // Customize ordered list items to include periods after numbers
110- orderedlistitem : ( text : string , num : number ) => ` ${ num } . ${ text } ` ,
110+ orderedlistitem : ( text : string , num : number ) =>
111+ ` ${ num || '' } . ${ text || '' } ` ,
111112 // Code blocks should preserve formatting with minimal spacing
112- code_block : ( text : string ) => `${ text } ` ,
113- fence : ( text : string , lang ?: string ) => `${ text } ` ,
113+ code_block : ( text : string ) => `${ text || '' } ` ,
114+ fence : ( text : string , lang ?: string ) => `${ text || '' } ` ,
114115 } ,
115116 } )
116117
0 commit comments