From feb52cf0bee40b30892b650a15204fe233c4aa21 Mon Sep 17 00:00:00 2001 From: kujo205 Date: Fri, 19 Apr 2024 00:21:54 +0300 Subject: [PATCH] fix: copy to clipboard on codeblock + added asm support --- src/components/mdPreview/components/Pre.tsx | 4 +++- src/providers/PrismJsProvider.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/mdPreview/components/Pre.tsx b/src/components/mdPreview/components/Pre.tsx index 7684b38..21c3484 100644 --- a/src/components/mdPreview/components/Pre.tsx +++ b/src/components/mdPreview/components/Pre.tsx @@ -7,6 +7,7 @@ import { useCopyToClipboard } from "@/hooks/useCopyToClipboard"; type PreChildren = { props: { className: string; + children: string; }; }; @@ -14,6 +15,7 @@ const Pre: React.FC< DetailedHTMLProps, HTMLPreElement> > = ({ children, ...props }) => { const lang = (children as PreChildren).props.className.split("-")[1]; + const preContent = (children as PreChildren).props.children; const { copy } = useCopyToClipboard(); @@ -25,7 +27,7 @@ const Pre: React.FC< diff --git a/src/providers/PrismJsProvider.tsx b/src/providers/PrismJsProvider.tsx index a05dab6..5ef5cd0 100644 --- a/src/providers/PrismJsProvider.tsx +++ b/src/providers/PrismJsProvider.tsx @@ -6,6 +6,7 @@ import "prismjs/components/prism-typescript"; import "prismjs/components/prism-javascript"; import "prismjs/components/prism-css"; import "prismjs/components/prism-jsx"; +import "prismjs/components/prism-asm6502"; import "prismjs/components/prism-bash"; import { usePathname, useSearchParams } from "next/navigation";