chatpad
chatpad copied to clipboard
Feature request: Code highlight
It would be very good to add code highlighting as it happens in chatGPT.
I changed the code using the same libraries you used and the result was this:
To allow this just import the library import { Prisma } from '@mantine/prism'; and changed the code, as below:
code: ({ node, inline, className, children, ...props }) =>
inline ? (
<Code {...props} children={children} />
) : (
<Box sx={{ position: "relative" }}>
{className ? (
<Prism
language={
className.replace("language-", "") as Language
}
>
{getCode(children)}
</Prism>
) : (
<Code block {...props} children={children} />
)}