From d08f9a73669feb9be1bbc383a8ec7d9782b05a0e Mon Sep 17 00:00:00 2001 From: Roe-xin Date: Mon, 12 Jan 2026 14:03:20 +0800 Subject: [PATCH] =?UTF-8?q?style:spec=E6=96=87=E6=A1=A3=E7=9A=84markdown?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/planCard.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/views/planCard.ts b/src/views/planCard.ts index c061e08..bdfafbf 100644 --- a/src/views/planCard.ts +++ b/src/views/planCard.ts @@ -62,9 +62,9 @@ export function getPlanCardStyles(): string { .plan-summary p { margin: 8px 0; } .plan-summary ul, .plan-summary ol { margin: 8px 0; - padding-left: 24px; + padding-left: 0; } - .plan-summary li { margin: 4px 0; } + .plan-summary li { margin: 4px 0 4px 27px; } .plan-summary code { background: var(--vscode-textCodeBlock-background); padding: 2px 6px; @@ -392,6 +392,12 @@ export function getPlanCardScript(): string { .replace(//g, '>'); + // 标题(必须在转义之后、其他处理之前) + html = html.replace(/^#### (.+)$/gm, '

$1

'); + html = html.replace(/^### (.+)$/gm, '

$1

'); + html = html.replace(/^## (.+)$/gm, '

$1

'); + html = html.replace(/^# (.+)$/gm, '

$1

'); + // 代码块 (\`\`\`code\`\`\`) html = html.replace(/\\x60\\x60\\x60([\\s\\S]*?)\\x60\\x60\\x60/g, '
$1
'); @@ -417,12 +423,6 @@ export function getPlanCardScript(): string { return table; }); - // 标题 - html = html.replace(/^#### (.+)$/gm, '

$1

'); - html = html.replace(/^### (.+)$/gm, '

$1

'); - html = html.replace(/^## (.+)$/gm, '

$1

'); - html = html.replace(/^# (.+)$/gm, '

$1

'); - // 粗体和斜体 html = html.replace(/\\*\\*(.+?)\\*\\*/g, '$1'); html = html.replace(/\\*(.+?)\\*/g, '$1');