Skip to content

Commit 0ff28cb

Browse files
committed
fixed errors on /app/articles/app/page and added types
1 parent 871253f commit 0ff28cb

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

app/(app)/articles/[slug]/page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import ArticleAdminPanel from "@/components/ArticleAdminPanel/ArticleAdminPanel"
1414
import { type Metadata } from "next";
1515
import { getPost } from "@/server/lib/posts";
1616
import { getCamelCaseFromLower } from "@/utils/utils";
17-
import { generateHTML } from "@tiptap/html";
17+
import { generateHTML } from "@tiptap/core";
1818
import { TiptapExtensions } from "@/components/editor/editor/extensions";
1919
import DOMPurify from "isomorphic-dompurify";
2020
import type { JSONContent } from "@tiptap/core";
@@ -119,11 +119,15 @@ const ArticlePage = async ({ params }: Props) => {
119119

120120
{isTiptapContent ? (
121121
<div
122-
dangerouslySetInnerHTML={{ __html: renderedContent }}
122+
dangerouslySetInnerHTML={{ __html: renderedContent ?? "" }}
123123
className="tiptap-content"
124124
/>
125125
) : (
126-
<div>{renderedContent}</div>
126+
<div>
127+
{Markdoc.renderers.react(renderedContent, React, {
128+
components: markdocComponents,
129+
})}
130+
</div>
127131
)}
128132
</article>
129133
{post.tags.length > 0 && (

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"@svgr/webpack": "^8.1.0",
118118
"@tailwindcss/typography": "^0.5.13",
119119
"@types/chance": "^1.1.6",
120+
"@types/dompurify": "^3.0.5",
120121
"@types/node": "^22.7.5",
121122
"@types/nodemailer": "^6.4.15",
122123
"@types/pg": "^8.11.5",

0 commit comments

Comments
 (0)