Skip to content

Commit 8f7a1bf

Browse files
committed
fix(formatters): use divider() in issue/list.ts and escape Seer text in headings
- issue/list.ts: replace inline muted("─".repeat(n)) with divider(n) from markdown.ts — the helper already exists and is re-exported via the formatters index; inlining it duplicated the helper logic - seer.ts buildRootCauseMarkdown: escape cause.description with escapeMarkdownInline() before embedding in the '### Cause #N: ...' heading - seer.ts formatSolution: escape solution.data.one_line_summary with escapeMarkdownInline() before embedding in '**Summary:** ...' bold text — Seer AI-generated text can contain underscores, asterisks, and backticks which the markdown parser would interpret as emphasis or code spans
1 parent 0cfeda9 commit 8f7a1bf

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/commands/issue/list.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
ValidationError,
3636
} from "../../lib/errors.js";
3737
import {
38+
divider,
3839
type FormatShortIdOptions,
3940
formatIssueListHeader,
4041
formatIssueRow,
@@ -117,7 +118,7 @@ function writeListHeader(
117118
): void {
118119
stdout.write(`${title}:\n\n`);
119120
stdout.write(muted(`${formatIssueListHeader(isMultiProject)}\n`));
120-
stdout.write(muted(`${"─".repeat(isMultiProject ? 96 : 80)}\n`));
121+
stdout.write(`${divider(isMultiProject ? 96 : 80)}\n`);
121122
}
122123

123124
/** Issue with formatting options attached */

src/lib/formatters/seer.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
} from "../../types/seer.js";
1313
import { SeerError } from "../errors.js";
1414
import { cyan } from "./colors.js";
15-
import { renderMarkdown } from "./markdown.js";
15+
import { escapeMarkdownInline, renderMarkdown } from "./markdown.js";
1616

1717
// Spinner Frames
1818

@@ -107,7 +107,9 @@ export function getProgressMessage(state: AutofixState): string {
107107
function buildRootCauseMarkdown(cause: RootCause, index: number): string {
108108
const lines: string[] = [];
109109

110-
lines.push(`### Cause #${index}: ${cause.description}`);
110+
lines.push(
111+
`### Cause #${index}: ${escapeMarkdownInline(cause.description ?? "")}`
112+
);
111113
lines.push("");
112114

113115
if (cause.relevant_repos && cause.relevant_repos.length > 0) {
@@ -257,7 +259,9 @@ export function formatSolution(solution: SolutionArtifact): string {
257259
lines.push("## Solution");
258260
lines.push("");
259261

260-
lines.push(`**Summary:** ${solution.data.one_line_summary}`);
262+
lines.push(
263+
`**Summary:** ${escapeMarkdownInline(solution.data.one_line_summary ?? "")}`
264+
);
261265
lines.push("");
262266

263267
if (solution.data.steps.length > 0) {

0 commit comments

Comments
 (0)