From 2d6d1b8e8a86aedc0f56a964cbec14df9c6a5e32 Mon Sep 17 00:00:00 2001 From: hyungi Date: Mon, 15 Jun 2026 14:05:35 +0900 Subject: [PATCH] =?UTF-8?q?fix(markdown):=20=EC=88=98=EC=8B=9D=20pre-rende?= =?UTF-8?q?r(katex=20=EC=A7=81=EC=A0=91)=20+=20TL;DR=20=EB=A7=88=ED=81=AC?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=20=EB=A0=8C=EB=8D=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 본문 $$수식$$가 raw로 노출되던 문제: marked-katex 토크나이저가 개요 anchor splice/런타임 환경 영향으로 미발화 → marked 이전에 katex.renderToString 으로 직접 렌더 후 placeholder 복원(위치·인접 무관). TL;DR(ai_tldr)도 plain-text 보간이라 마크다운 미렌더 → renderDocMarkdown 경유로 교체(+summary-md 스타일). Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/app.css | 11 ++++ .../src/lib/components/AnalysisPanel.svelte | 5 +- frontend/src/lib/utils/docMarkdown.ts | 52 ++++++++++++++++++- .../src/routes/documents/[id]/+page.svelte | 3 +- 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index f7b6d63..ae4a8bb 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -213,3 +213,14 @@ body { /* Phase 1C: frontmatter 박스 — 본문 위 메타 표시 */ .md-frontmatter dt { font-weight: 500; } + +/* AI 요약(TL;DR 등) 마크다운 렌더 — 좁은 카드에 맞게 문단/리스트 마진 압축 */ +.summary-md > :first-child { margin-top: 0; } +.summary-md > :last-child { margin-bottom: 0; } +.summary-md p { margin: 0 0 0.45em; } +.summary-md ul, .summary-md ol { margin: 0.25em 0; padding-left: 1.2em; } +.summary-md ul { list-style: disc; } +.summary-md ol { list-style: decimal; } +.summary-md li { margin: 0.1em 0; } +.summary-md strong { font-weight: 700; } +.summary-md code { background: rgba(0, 0, 0, 0.05); padding: 0 0.3em; border-radius: 3px; } diff --git a/frontend/src/lib/components/AnalysisPanel.svelte b/frontend/src/lib/components/AnalysisPanel.svelte index 557c644..b6d23a9 100644 --- a/frontend/src/lib/components/AnalysisPanel.svelte +++ b/frontend/src/lib/components/AnalysisPanel.svelte @@ -12,6 +12,7 @@ -->