Skip to content

Commit d122c7d

Browse files
committed
fix: parse overlay markdown body to HTML before storing
The overlay body was stored as raw markdown but rendered via raw() on detail pages, which expects HTML. Now uses marked.parse() during load so headings, emphasis, and paragraphs render correctly.
1 parent c3d5c77 commit d122c7d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/catalog/overlays.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { parse as parseYaml } from 'yaml'
2+
import { marked } from 'marked'
23
import type { Overlay } from './types'
34

45
const FRONTMATTER_RE = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/
@@ -20,7 +21,7 @@ export async function loadOverlay(path: string): Promise<Overlay | null> {
2021
summary: stringOrUndefined(frontMatter.summary),
2122
highlights: stringArrayOrUndefined(frontMatter.highlights),
2223
related: stringArrayOrUndefined(frontMatter.related),
23-
body: body || undefined,
24+
body: body ? (marked.parse(body, { async: false }) as string) : undefined,
2425
}
2526
}
2627

0 commit comments

Comments
 (0)