diff options
| author | jackyzha0 <[email protected]> | 2020-09-04 11:31:47 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-09-04 11:31:47 -0700 |
| commit | 006b0208e1d0cfcaddf2842e38a3d7fd2374f136 (patch) | |
| tree | f0e277d990ce451cc437c4a2cbec741f90d4a4eb /frontend/src/components/renderers/InlineCode.js | |
| parent | add md class to preview renderer (diff) | |
| download | ctrl-v-006b0208e1d0cfcaddf2842e38a3d7fd2374f136.tar.xz ctrl-v-006b0208e1d0cfcaddf2842e38a3d7fd2374f136.zip | |
add code highlighting to md
Diffstat (limited to 'frontend/src/components/renderers/InlineCode.js')
| -rw-r--r-- | frontend/src/components/renderers/InlineCode.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/frontend/src/components/renderers/InlineCode.js b/frontend/src/components/renderers/InlineCode.js new file mode 100644 index 0000000..36c2ac2 --- /dev/null +++ b/frontend/src/components/renderers/InlineCode.js @@ -0,0 +1,16 @@ +import React from 'react'; +import SyntaxHighlighter from 'react-syntax-highlighter'; +import { atomOneLight } from 'react-syntax-highlighter/dist/esm/styles/hljs'; +import { LANGS } from './Code' + +const MarkdownCodeRenderer = (props) => { + return ( + <SyntaxHighlighter + language={LANGS[props.language]} + style={atomOneLight}> + {props.value} + </SyntaxHighlighter> + ); +}; + +export default MarkdownCodeRenderer;
\ No newline at end of file |