diff --git a/package.json b/package.json index 18207ff..a28a82d 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,9 @@ "dependencies": { "commander": "^13.1.0" }, + "scripts": { + "test:markdown": "bun src/test-markdown.ts" + }, "devDependencies": { "@types/bun": "^1.3.9" } diff --git a/src/markdown.ts b/src/markdown.ts index c9eb259..d53c4fb 100644 --- a/src/markdown.ts +++ b/src/markdown.ts @@ -14,7 +14,7 @@ export function renderMarkdown(text: string): string { // Restore code spans as light blue result = result.replace(/\x00CODE(\d+)\x00/g, (_, i) => { - return `\x1b[94m${codeSpans[parseInt(i)]}\x1b[39m` + return `\x1b[38;5;147m${codeSpans[parseInt(i)]}\x1b[39m` }) return result diff --git a/src/test-markdown.ts b/src/test-markdown.ts new file mode 100644 index 0000000..b505ff6 --- /dev/null +++ b/src/test-markdown.ts @@ -0,0 +1,18 @@ +import { renderMarkdown } from "./markdown" + +const lines = [ + "This is **bold** text", + "This is *italic* text", + "This is `inline code` text", + "Mix of **bold**, *italic*, and `code` in one line", + "**bold with `code` inside** bold", + "No markdown here", + "Multiple **bold one** and **bold two**", + "Nested-ish: **bold and *italic* together**", +] + +for (const line of lines) { + console.log(` ${line}`) + console.log(` ${renderMarkdown(line)}`) + console.log() +}