mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-08 02:11:44 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user