@@ -275,17 +275,22 @@ function generateMarkdownForPathResults(
275275 threadFlow . highlightedRegion ?. startLine ,
276276 threadFlow . highlightedRegion ?. endLine ,
277277 ) ;
278- const codeSnippet = generateMarkdownForCodeSnippet (
279- threadFlow . codeSnippet ,
280- language ,
281- threadFlow . highlightedRegion ,
282- ) ;
283- // Indent the snippet to fit with the numbered list.
284- // The indentation is "n + 2" where the list number is an n-digit number.
285- const codeSnippetIndented = codeSnippet . map ( ( line ) =>
286- ( " " . repeat ( listNumber . toString ( ) . length + 2 ) + line ) . trimEnd ( ) ,
287- ) ;
288- pathLines . push ( `${ listNumber } . ${ link } ` , ...codeSnippetIndented ) ;
278+ pathLines . push ( `${ listNumber } . ${ link } ` ) ;
279+
280+ if ( threadFlow . codeSnippet ) {
281+ const codeSnippet = generateMarkdownForCodeSnippet (
282+ threadFlow . codeSnippet ,
283+ language ,
284+ threadFlow . highlightedRegion ,
285+ ) ;
286+ // Indent the snippet to fit with the numbered list.
287+ // The indentation is "n + 2" where the list number is an n-digit number.
288+ pathLines . push (
289+ ...codeSnippet . map ( ( line ) =>
290+ ( " " . repeat ( listNumber . toString ( ) . length + 2 ) + line ) . trimEnd ( ) ,
291+ ) ,
292+ ) ;
293+ }
289294 }
290295 lines . push ( ...buildExpandableMarkdownSection ( title , pathLines ) ) ;
291296 }
0 commit comments