fix(documents): 절뷰(hasSections) 본문을 MarkdownDoc로 렌더 — 수식·이미지 살림

★진짜 원인: 절 있는 문서(useSectionView)는 절 본문을 plain marked(renderMd)로 렌더해
수식(katex 없음 → raw $$)·이미지(docimg → DOMPurify 미지원프로토콜 제거 → 사라짐)가
전부 깨졌다. 앞선 renderDocMarkdown 수정들은 !hasSections 경로뿐이라 절뷰 문서엔 미적용.
절 bodyText 에 docimg·$$ 실재 확인(3791: docimg 21·blockmath). 데스크탑/모바일 절 본문
{@html renderMd} → <MarkdownDoc documentId mdContent={bodyText}> 로 교체 → pre-render
(수식·이미지 placeholder) + swap(실제 이미지) 적용.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hyungi
2026-06-16 06:42:24 +09:00
parent db7ede04b7
commit 96bd849bcb
@@ -239,8 +239,8 @@
{/if}
</div>
{/if}
{#if selectedBodyHtml}
<div class="prose prose-base max-w-none text-text">{@html selectedBodyHtml}</div>
{#if selectedItem?.bodyText}
<MarkdownDoc documentId={doc.id} mdContent={selectedItem.bodyText} mdStatus={null} class="prose prose-base max-w-none text-text" />
{:else}
<p style="color:#9aa090;font-size:14px;font-style:italic;">이 절의 본문은 추출되지 않았습니다. 헤더의 '원본'에서 확인하세요.</p>
{/if}
@@ -339,7 +339,7 @@
{#if it.bodyText}
<details class="m-secbody" ontoggle={(e) => { if (e.currentTarget.open) mBodyOpen[s.chunk_id] = true; }}>
<summary style="cursor:pointer;list-style:none;font-size:12px;color:#697061;padding:5px 0;user-select:none;display:flex;align-items:center;gap:5px;">본문 보기 <span class="m-chev" style="transition:transform .16s;color:#9aa090;"></span></summary>
{#if mBodyOpen[s.chunk_id]}<div class="prose prose-sm max-w-none text-text" style="margin-top:6px;">{@html bodyHtml(it)}</div>{/if}
{#if mBodyOpen[s.chunk_id]}<div style="margin-top:6px;"><MarkdownDoc documentId={doc.id} mdContent={it.bodyText} mdStatus={null} class="prose prose-sm max-w-none text-text" /></div>{/if}
</details>
{/if}
</div>