fix codeblock
This commit is contained in:
parent
33f390ca92
commit
8ce1c1baf9
@ -1,7 +1,6 @@
|
|||||||
import { ReactElement } from "react";
|
import { ReactElement } from "react";
|
||||||
import SyntaxHighlighter from "react-syntax-highlighter";
|
import SyntaxHighlighter from "react-syntax-highlighter";
|
||||||
import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs";
|
import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs";
|
||||||
import { cn } from "@/app/common/utils";
|
|
||||||
import { jetbrainsMono } from "@/app/common/font/font";
|
import { jetbrainsMono } from "@/app/common/font/font";
|
||||||
|
|
||||||
type CodeBlockProps = {
|
type CodeBlockProps = {
|
||||||
@ -14,11 +13,9 @@ type CodeBlockProps = {
|
|||||||
export function CodeBlock({ code }: CodeBlockProps): ReactElement {
|
export function CodeBlock({ code }: CodeBlockProps): ReactElement {
|
||||||
return (
|
return (
|
||||||
<SyntaxHighlighter
|
<SyntaxHighlighter
|
||||||
className="break-all !bg-transparent text-xs"
|
className="!bg-transparent text-xs"
|
||||||
style={atomOneDark}
|
style={atomOneDark}
|
||||||
wrapLongLines
|
|
||||||
showLineNumbers
|
showLineNumbers
|
||||||
PreTag={"div"}
|
|
||||||
codeTagProps={{
|
codeTagProps={{
|
||||||
style: {
|
style: {
|
||||||
fontFamily: jetbrainsMono.style.fontFamily,
|
fontFamily: jetbrainsMono.style.fontFamily,
|
||||||
|
Reference in New Issue
Block a user