diff options
| author | jackyzha0 <[email protected]> | 2020-05-26 00:09:07 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-05-26 00:09:07 -0700 |
| commit | 236c38871913d6c2a1a06cfc45bd2ef6e7ab9af1 (patch) | |
| tree | f7851f60131b77676102aaf2c019b1f37d28f1c3 /frontend/src/components | |
| parent | various fixes (diff) | |
| download | ctrl-v-236c38871913d6c2a1a06cfc45bd2ef6e7ab9af1.tar.xz ctrl-v-236c38871913d6c2a1a06cfc45bd2ef6e7ab9af1.zip | |
fix coderenderer not loading all langs
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/renderers/Code.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/src/components/renderers/Code.js b/frontend/src/components/renderers/Code.js index 524ea30..3dbd544 100644 --- a/frontend/src/components/renderers/Code.js +++ b/frontend/src/components/renderers/Code.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; +import SyntaxHighlighter from 'react-syntax-highlighter'; import { atomOneLight, ascetic, atomOneDark, dracula, ocean } from 'react-syntax-highlighter/dist/esm/styles/hljs'; import styled from 'styled-components' @@ -23,6 +23,7 @@ export const LANGS = Object.freeze({ 'html': 'html', 'java': 'java', 'js': 'javascript', + 'jsx': 'jsx', 'latex': 'latex', 'lisp': 'lisp', 'makefile': 'makefile', @@ -64,7 +65,7 @@ const CodeRenderer = React.forwardRef((props, ref) => { <div className="lt-shadow"> <SyntaxHighlighter ref={ref} - language={props.lang} + language={LANGS[props.lang]} style={THEMES[props.theme]} showLineNumbers PreTag={Pre}> |