diff --git a/src/components/Rendering/Code.js b/src/components/Rendering/Code.js index 772e9eb..759a9e4 100644 --- a/src/components/Rendering/Code.js +++ b/src/components/Rendering/Code.js @@ -1,10 +1,14 @@ import SyntaxHighlighter from 'react-syntax-highlighter' import {monokai} from "react-syntax-highlighter/dist/cjs/styles/hljs"; import stripTabs from "../../utils/stripTabs"; +import {useContext} from "preact/hooks"; +import CodeDefaultLanguage from "../../contexts/CodeDefaultLanguage"; export default function(props) { + const language = useContext(CodeDefaultLanguage) + return ( - + {stripTabs(String(props.children))} ) diff --git a/src/contexts/CodeDefaultLanguage.js b/src/contexts/CodeDefaultLanguage.js new file mode 100644 index 0000000..680fcae --- /dev/null +++ b/src/contexts/CodeDefaultLanguage.js @@ -0,0 +1,3 @@ +import {createContext} from "preact"; + +export default createContext("plaintext");