jpmorganchase / mosaic

https://mosaic-mosaic-dev-team.vercel.app
https://mosaic-mosaic-dev-team.vercel.app
Apache License 2.0
22 stars 20 forks source link

Replace Prism js with Shiki #324

Open DavieReid opened 1 year ago

DavieReid commented 1 year ago

We currently use Prism for code highlighting. It doesn't seem to work very well and I have heard a lot about Shiki recently that is supposed to be better.

I think this rehype plugin would do the job rehype-pretty-code

lilyvc commented 1 year ago

I attempted to do this here: https://github.com/jpmorganchase/mosaic/blob/replace-prism-with-shiki/packages/components/src/Markdown/Pre/index.tsx but got stuck with this error when serving the site Unhandled Runtime Error TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

DavieReid commented 1 year ago

I think I had this working but had issues with light/dark mode (they both show up simultaneously). Will show u what I have when I'm back.