Skip to content

Commit

Permalink
Wrap text in syntaxhighlighter to avoid overflow (#345)
Browse files Browse the repository at this point in the history
Fixes #344
  • Loading branch information
wesbillman authored Aug 31, 2023
1 parent cf6f9d5 commit 7a66de4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion console/client/src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ export const CodeBlock: React.FC<Props> = ({

return (
<SyntaxHighlighter
wrapLongLines={true}
lineProps={{style: {flexWrap: 'wrap'}}}
language={language}
style={
isDarkMode
? (atomDark as React.CSSProperties)
: (oneLight as React.CSSProperties)
}
customStyle={{fontSize: '12px', maxHeight: `${maxHeight}px`}}
customStyle={{
fontSize: '12px',
maxHeight: `${maxHeight}px`,
overflow: 'auto',
maxWidth: `100%`,
}}
>
{code}
</SyntaxHighlighter>
Expand Down

0 comments on commit 7a66de4

Please sign in to comment.