mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-12-01 17:24:48 +00:00
Sanitize rendered web content (#77)
This commit is contained in:
parent
cb192906bd
commit
59013cf0af
6 changed files with 167 additions and 133 deletions
|
|
@ -5,6 +5,7 @@ import type { Metadata } from "next";
|
|||
import { marked } from "marked";
|
||||
import { DOC_SLUGS, docExcerpt, docTitle, readDoc } from "@/lib/docs";
|
||||
import { SiteShell } from "@/components/site-shell";
|
||||
import { sanitizeRenderedHtml } from "@/lib/html";
|
||||
|
||||
// Statically generate one page per curated doc at build time.
|
||||
export function generateStaticParams(): Array<{ slug: string }> {
|
||||
|
|
@ -37,7 +38,8 @@ export default async function DocPage({
|
|||
const md = readDoc(slug);
|
||||
if (!md) notFound();
|
||||
|
||||
const html = await marked.parse(md);
|
||||
const rawHtml = await marked.parse(md);
|
||||
const html = sanitizeRenderedHtml(rawHtml);
|
||||
|
||||
return (
|
||||
<SiteShell active="Docs">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue