Skip to content

Commit 43f2601

Browse files
betegonclaude
andcommitted
fix(init): use colorTag instead of raw ANSI for file action icons
Raw chalk/color helpers embed ANSI escape codes into markdown source, which can break marked's lexer on unmatched brackets. Use colorTag() to produce <green>/<red>/<yellow> tags that the custom markdown renderer handles correctly in both TTY and plain output modes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4035f47 commit 43f2601

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/init/formatters.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66

77
import { cancel, log, outro } from "@clack/prompts";
8-
import { green, red, terminalLink, yellow } from "../formatters/colors.js";
9-
import { mdKvTable, renderMarkdown } from "../formatters/markdown.js";
8+
import { terminalLink } from "../formatters/colors.js";
9+
import { colorTag, mdKvTable, renderMarkdown } from "../formatters/markdown.js";
1010
import { featureLabel } from "./clack-utils.js";
1111
import {
1212
EXIT_DEPENDENCY_INSTALL_FAILED,
@@ -17,12 +17,12 @@ import type { WizardOutput, WorkflowRunResult } from "./types.js";
1717

1818
function fileActionIcon(action: string): string {
1919
if (action === "create") {
20-
return green("+");
20+
return colorTag("green", "+");
2121
}
2222
if (action === "delete") {
23-
return red("-");
23+
return colorTag("red", "-");
2424
}
25-
return yellow("~");
25+
return colorTag("yellow", "~");
2626
}
2727

2828
function buildSummary(output: WizardOutput): string {

0 commit comments

Comments
 (0)