diff --git a/src/app/api/posts/[slug]/route.ts b/src/app/api/posts/[slug]/route.ts index 45f03f7..e45cc7d 100644 --- a/src/app/api/posts/[slug]/route.ts +++ b/src/app/api/posts/[slug]/route.ts @@ -26,20 +26,18 @@ async function getPostBySlug(slug: string) { // Configure marked options marked.setOptions({ gfm: true, - breaks: true, - headerIds: true, - mangle: false + breaks: true }); // Convert markdown to HTML - const rawHtml = marked(content); + const rawHtml = marked.parse(content); // Create a DOM window for DOMPurify const window = new JSDOM('').window; const purify = DOMPurify(window); // Sanitize the HTML - processedContent = purify.sanitize(rawHtml, { + processedContent = purify.sanitize(rawHtml as string, { ALLOWED_TAGS: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'a', 'ul', 'ol', 'li', 'blockquote',