📚 Documentation
Hihglight.js hasn't made progress on support for JSX in over two years, so a lot React-based projects will need to use Prism for highlighting instead. It seems like Prism understands the highlight.theme config option but it's unclear where it gets its themes - they don't have the same names as the Highlight.js ones except in a few cases like "default", and even then they look different.
{
// Highlight.js doesn't work well with JSX
// pass an array of languages to use Prism, or true for all
// usePrism: ['jsx'],
usePrism: true,
highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks.
// Need to pass a value here that also works with Prism
// theme: 'gruvbox-dark',
theme: "default",
defaultLang: "javascript"
},
}
Yes
📚 Documentation
Hihglight.js hasn't made progress on support for JSX in over two years, so a lot React-based projects will need to use Prism for highlighting instead. It seems like Prism understands the
highlight.themeconfig option but it's unclear where it gets its themes - they don't have the same names as the Highlight.js ones except in a few cases like "default", and even then they look different.Have you read the Contributing Guidelines on issues?
Yes