File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ import { writeJson } from "./json.js";
1212type WriteOutputOptions < T > = {
1313 /** Output JSON format instead of human-readable */
1414 json : boolean ;
15- /** Function to format data as a rendered string or string array */
16- formatHuman : ( data : T ) => string | string [ ] ;
15+ /** Function to format data as a rendered string */
16+ formatHuman : ( data : T ) => string ;
1717 /** Optional source description if data was auto-detected */
1818 detectedFrom ?: string ;
1919} ;
@@ -36,8 +36,7 @@ export function writeOutput<T>(
3636 return ;
3737 }
3838
39- const output = options . formatHuman ( data ) ;
40- const text = Array . isArray ( output ) ? output . join ( "\n" ) : output ;
39+ const text = options . formatHuman ( data ) ;
4140 stdout . write ( `${ text } \n` ) ;
4241
4342 if ( options . detectedFrom ) {
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ function buildRootCauseMarkdown(cause: RootCause, index: number): string {
124124 lines . push ( "**Reproduction steps:**" ) ;
125125 lines . push ( "" ) ;
126126 for ( const step of cause . root_cause_reproduction ) {
127- lines . push ( `**${ step . title } **` ) ;
127+ lines . push ( `**${ escapeMarkdownInline ( step . title ) } **` ) ;
128128 lines . push ( "" ) ;
129129 // code_snippet_and_analysis may itself contain markdown (code fences,
130130 // inline code, etc.) — pass it through as-is so marked renders it.
@@ -270,7 +270,7 @@ export function formatSolution(solution: SolutionArtifact): string {
270270 for ( let i = 0 ; i < solution . data . steps . length ; i ++ ) {
271271 const step = solution . data . steps [ i ] ;
272272 if ( step ) {
273- lines . push ( `${ i + 1 } . **${ step . title } **` ) ;
273+ lines . push ( `${ i + 1 } . **${ escapeMarkdownInline ( step . title ) } **` ) ;
274274 lines . push ( "" ) ;
275275 // step.description may contain markdown — pass it through as-is
276276 lines . push ( ` ${ step . description . split ( "\n" ) . join ( "\n " ) } ` ) ;
You can’t perform that action at this time.
0 commit comments