diff --git a/ui/src/routes/books/[slug]/chapters/[n]/+page.server.ts b/ui/src/routes/books/[slug]/chapters/[n]/+page.server.ts index 2a45c2e..0088f7f 100644 --- a/ui/src/routes/books/[slug]/chapters/[n]/+page.server.ts +++ b/ui/src/routes/books/[slug]/chapters/[n]/+page.server.ts @@ -154,7 +154,7 @@ export const load: PageServerLoad = async ({ params, url, locals }) => { error(res.status === 404 ? 404 : 502, res.status === 404 ? `Chapter ${n} not found` : 'Could not fetch chapter content'); } const markdown = await res.text(); - html = marked(markdown) as string; + html = await marked(markdown); } catch (e) { if (e instanceof Error && 'status' in e) throw e; // Don't hard-fail — show empty content with error message