Skip to content

Commit

Permalink
fix: move to listener to loc
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace committed Sep 20, 2024
1 parent e89fc15 commit 5f3cddf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions app/(routes)/(main)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Image from 'next/image';
import { Badge } from '@/components/ui/badge';
import Markdown from '@/components/markdown';
import TableOfContents from '@/app/_components/_main/table-of-contents';
import MarkdownCopyListener from '@/app/_components/_main/markdown-copy-listener';

export async function generateMetadata({
params,
Expand Down Expand Up @@ -81,7 +80,6 @@ export default async function Page({ params }: { params: { slug: string } }) {
)}
</div>
<Markdown markdown={postData.content} />
<MarkdownCopyListener />
{headings.length > 0 && <TableOfContents headings={headings} />}
</>
);
Expand Down
6 changes: 4 additions & 2 deletions components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DOMPurify from 'isomorphic-dompurify';
import hljs from 'highlight.js/lib/core';
import '@/styles/hljs/github-dark.css';
import { escapeText } from '@/lib/utils';
import MarkdownCopyListener from '@/app/_components/_main/markdown-copy-listener';

const languages = {
plaintext: () => import('highlight.js/lib/languages/plaintext'),
Expand Down Expand Up @@ -75,7 +76,7 @@ const Markdown = ({ markdown }: { markdown: string }) => {
},
);

return (
return <>
<article
className="prose dark:prose-invert prose-pre:rounded-2xl prose-pre:bg-secondary/25"
dangerouslySetInnerHTML={{
Expand All @@ -84,7 +85,8 @@ const Markdown = ({ markdown }: { markdown: string }) => {
}),
}}
></article>
);
<MarkdownCopyListener />
</>
};

export default Markdown;

0 comments on commit 5f3cddf

Please sign in to comment.