mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-10-02 12:54:03 +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
|
|
@ -4,6 +4,7 @@ import type { ReactNode } from "react";
|
|||
import type { Metadata } from "next";
|
||||
import { publicClient } from "@/lib/supabase";
|
||||
import { SiteShell } from "@/components/site-shell";
|
||||
import { sanitizeRenderedHtml } from "@/lib/html";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
|
@ -84,6 +85,7 @@ export default async function BlogPostPage({
|
|||
mainEntityOfPage: `${SITE_URL}/blog/${post.slug}`,
|
||||
publisher: { "@id": `${SITE_URL}/#organization` },
|
||||
};
|
||||
const html = sanitizeRenderedHtml(post.html);
|
||||
|
||||
return (
|
||||
<SiteShell active="Blog">
|
||||
|
|
@ -114,7 +116,7 @@ export default async function BlogPostPage({
|
|||
<div
|
||||
className="blog-content"
|
||||
style={{ lineHeight: 1.7 }}
|
||||
dangerouslySetInnerHTML={{ __html: post.html }}
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
</article>
|
||||
</SiteShell>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue