mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-09-11 06:35:24 +03:00
19 lines
363 B
JavaScript
19 lines
363 B
JavaScript
import React from 'react'
|
|
import { Prism } from 'react-syntax-highlighter'
|
|
|
|
import { getLanguage } from './syntax-highlighter'
|
|
|
|
export const pre = props => props.children
|
|
|
|
export const code = props => {
|
|
const language = getLanguage(props.className)
|
|
return <Prism language={language} {...props} />
|
|
}
|
|
|
|
export default {
|
|
components: {
|
|
pre,
|
|
code,
|
|
},
|
|
}
|