Open rogercarrijo opened 1 year ago
How can we detect the langage of the code sample?
highlight.js supports syntax highlighting with language detection
Made a quick PR for this!: https://github.com/deiucanta/chatpad/pull/54
Note, poking around in the developer console for ChatGPT, it seems like they're using hljs too. This means, with the above PR we should have the same quality (or lack thereof) of highlighting as they do!
Made another implementation before I saw this. Maybe it will be useful too https://github.com/deiucanta/chatpad/pull/68
Add support for almost all languages
Hey @deiucanta! Can you please check this?
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:![image](https://user-images.githubusercontent.com/41712756/229019608-662261d0-45d8-4141-8710-85457e312f5f.png)
To allow this just import the library import { Prisma } from '@mantine/prism'; and changed the code, as below: