Fix wordwrap by default on docs (#3776)

* feat: fixes on docs website

* fix: tab issue

* fix: wordwrap by default cannot happen in every codeblock
This commit is contained in:
jose-donato
2022-12-15 12:58:13 +00:00
committed by GitHub
parent baa8bc6f39
commit d594cbd82e
2 changed files with 6 additions and 3 deletions

View File

@@ -41,6 +41,9 @@ export default function CodeBlockString({
});
const showLineNumbers =
showLineNumbersProp ?? containsLineNumbers(metastring);
const shouldWordwrapByDefault = code.startsWith("openbb.")
return (
<Container
as="div"
@@ -67,10 +70,10 @@ export default function CodeBlockString({
className={clsx(className, styles.codeBlock, "thin-scrollbar")}
>
<code
style={{
style={shouldWordwrapByDefault ? {
whiteSpace: 'pre-wrap',
overflowWrap: 'anywhere'
}}
} : {}}
className={clsx(
styles.codeBlockLines,
showLineNumbers && styles.codeBlockLinesWithNumbering