Add Syntax Highlighting to Sidebar Code Snippets

This commit is contained in:
Tom Spielvogel 2024-10-16 13:26:24 +02:00 committed by GitHub
parent f86b84dcc6
commit a69e1b940f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,7 @@ const RenderToken = ({ token, nested = false }: { token: Token | string, nested?
}
if (t.type === "code") {
return <BlockCode text={t.text} />
return <BlockCode text={t.text} language={t.lang} />
}
if (t.type === "heading") {
@ -165,4 +165,4 @@ const MarkdownRender = ({ string, nested = false }: { string: string, nested?: b
)
}
export default MarkdownRender
export default MarkdownRender