From 0ad173ef8f290de929544c90fc3292e59c8213f9 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 20 Feb 2026 09:00:49 -0800 Subject: [PATCH] Add heading and blockquote rendering to markdown formatter --- src/markdown.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/markdown.ts b/src/markdown.ts index f3e7114..064d22f 100644 --- a/src/markdown.ts +++ b/src/markdown.ts @@ -9,6 +9,15 @@ export function renderMarkdown(text: string): string { return `\x00CODE${codeSpans.length - 1}\x00` }) + // H1: # Header → bold+italic+underline + result = result.replace(/^# (.+)$/gm, "\x1b[1;3;4m$1\x1b[22;23;24m") + + // H2/H3: ## Header / ### Header → bold + result = result.replace(/^#{2,3} (.+)$/gm, "\x1b[1m$1\x1b[22m") + + // Blockquotes: > text → dim+italic + result = result.replace(/^> (.+)$/gm, "\x1b[2;3m$1\x1b[22;23m") + // Bold: **text** result = result.replace(/\*\*(.+?)\*\*/g, "\x1b[1m$1\x1b[22m")