Open anriclee opened 2 years ago
At the top of your file where you import the Code
component, add the following additions.
const Code = dynamic(
() => import('react-notion-x/build/third-party/code').then(async (m) => {
await Promise.all([
import('prismjs/components/prism-go.js'), // this line imports go syntax highlighting
])
return m.Code as any
}),
)
If you would like to add support for other programming languages, just provide more imports in the Promise.all
and change the import language name from prism-go.js
to prism-[Language]
.
Hope this helps!
Description
Code block highlight Golang not supported?
Notion Test Page ID
https://www.notion.so/anriclee/Adding-HTTP-response-headers-to-a-Netlify-static-website-61e28b5d902d464dbf199047d1fb7dda