aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/Inputs/Code.js8
-rw-r--r--frontend/src/components/renderers/Code.js9
2 files changed, 14 insertions, 3 deletions
diff --git a/frontend/src/components/Inputs/Code.js b/frontend/src/components/Inputs/Code.js
index adb1536..96c08c4 100644
--- a/frontend/src/components/Inputs/Code.js
+++ b/frontend/src/components/Inputs/Code.js
@@ -6,11 +6,15 @@ import {Highlighter} from "../renderers/Code";
import {CodeLike, Hover} from "../Common/mixins";
const Wrapper = styled.div`
+ display: block;
position: relative;
+ width: calc(100%);
`
+
const EditorWrapper = styled(Editor)`
overflow: visible !important;
-
+ position: relative;
+
& > * {
padding: 0 !important;
width: 100%;
@@ -18,7 +22,7 @@ const EditorWrapper = styled(Editor)`
& pre, & code, & > textarea {
${CodeLike}
- min-height: 40vh;
+ // min-height: 40vh;
}
& pre {
diff --git a/frontend/src/components/renderers/Code.js b/frontend/src/components/renderers/Code.js
index 85fd5ab..c932add 100644
--- a/frontend/src/components/renderers/Code.js
+++ b/frontend/src/components/renderers/Code.js
@@ -40,11 +40,18 @@ export const StyledPre = styled.pre`
}
`
+const PreWithBr = (props) => (
+ <StyledPre {...props}>
+ {props.children}
+ <br />
+ </StyledPre>
+)
+
export const Highlighter = ({language, lineNumbers, theme, pre = StyledPre, children}) => <SyntaxHighlighter
language={LANGS[language]}
style={THEMES[theme]}
showLineNumbers={lineNumbers}
- PreTag={pre}>
+ PreTag={PreWithBr}>
{children}
</SyntaxHighlighter>