Skip to content

Commit 039fa88

Browse files
idk
1 parent e156dfd commit 039fa88

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/components/CodeBlock.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ function escapeHtml(str: string) {
5656
interface Props {
5757
code: string;
5858
lang?: string;
59+
className?: string;
5960
}
6061

61-
export default function CodeBlock({ code, lang = "java" }: Props) {
62+
export default function CodeBlock({ code, lang = "java", className = "" }: Props) {
6263
const theme = useTheme();
6364
const themeName = theme === "dark" ? "github-dark" : "github-light";
6465
const [html, setHtml] = useState<string>("");
@@ -79,6 +80,6 @@ export default function CodeBlock({ code, lang = "java" }: Props) {
7980
}, [code, lang, themeName]);
8081

8182
return (
82-
<div className="bg-card *:bg-transparent! rounded-lg p-4 border border-border overflow-x-auto my-6" dangerouslySetInnerHTML={{ __html: html }} />
83+
<div className={`bg-card *:bg-transparent! rounded-lg p-4 border border-border overflow-x-auto my-6 ${className}`} dangerouslySetInnerHTML={{ __html: html }} />
8384
);
8485
}

0 commit comments

Comments
 (0)