Closed rexwebmedia closed 2 years ago
There is not enough information to help. "Not working with remark-prism" is not an helpful issue. Please refer to asking quality questions.
In the meantime, I recommend taking a look at this example with react-markdown
: https://github.com/remarkjs/react-markdown#use-custom-components-syntax-highlight. The components
prop from that package is similar to rehypeReactOptions.components
from this package so it could serve as inspiration. Alternatively, switch to react-markdown
and use that example.
Here's a minimal example https://stackblitz.com/edit/nextjs-sfulsg?file=pages/index.js
This is a bug in that plugin. Raise it there. They have several open issues, perhaps it is already reported.
You initially mentioned “Any lightweight syntax highlighter support.” as a solution you are looking for. I believe remark-prism
isn’t that. Perhaps you should use the highligher we maintain: https://github.com/rehypejs/rehype-highlight. Or https://github.com/mapbox/rehype-prism if you want prism.
Initial checklist
Problem
Not working with remark-prism.
Solution
Any lightweight syntax highlighter support.
Alternatives
Can't find any alternatives.