diff --git a/src/components/CodeBlock.module.css b/src/components/CodeBlock.module.css index fc9ff9e..f04d8c3 100644 --- a/src/components/CodeBlock.module.css +++ b/src/components/CodeBlock.module.css @@ -124,10 +124,10 @@ font-family: var(--mono-font) !important; font-size: var(--code-font-size); line-height: var(--code-line-height); - overflow-x: hidden; + overflow-x: auto; white-space: pre-wrap; - word-break: break-word; - overflow-wrap: anywhere; + word-break: normal; + overflow-wrap: break-word; color: var(--code-text-color); border: none; box-shadow: none; @@ -136,8 +136,8 @@ .codeBlockContent pre, .codeBlockContent code { white-space: pre-wrap !important; - word-break: break-word; - overflow-wrap: anywhere; + word-break: normal; + overflow-wrap: break-word; } .codeBlockContent code { diff --git a/src/components/CodeBlock.tsx b/src/components/CodeBlock.tsx index b8610ad..b317b7c 100644 --- a/src/components/CodeBlock.tsx +++ b/src/components/CodeBlock.tsx @@ -369,17 +369,17 @@ const CodeBlock: React.FC = React.memo( fontSize: 'var(--code-font-size)', lineHeight: 'var(--code-line-height)', whiteSpace: 'pre-wrap', - wordBreak: 'break-word', - overflowWrap: 'anywhere', - overflowX: 'hidden', + wordBreak: 'normal', + overflowWrap: 'break-word', + overflowX: 'auto', }} codeTagProps={{ style: { fontFamily: 'var(--mono-font)', fontSize: 'inherit', whiteSpace: 'pre-wrap', - wordBreak: 'break-word', - overflowWrap: 'anywhere', + wordBreak: 'normal', + overflowWrap: 'break-word', }, }} > diff --git a/src/components/HostedFilePreview.tsx b/src/components/HostedFilePreview.tsx index a6c3317..585886e 100644 --- a/src/components/HostedFilePreview.tsx +++ b/src/components/HostedFilePreview.tsx @@ -80,7 +80,8 @@ export default function HostedFilePreview({ assetUrl, assetLabel }: HostedFilePr
); diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index f8c756b..a0af41a 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -265,7 +265,7 @@ export default function Navigation({ > {siteName} diff --git a/src/globals.css b/src/globals.css index c6bca2f..b8c6e3f 100644 --- a/src/globals.css +++ b/src/globals.css @@ -721,10 +721,10 @@ a:focus-visible { /* Inline code styles for markdown */ pre { max-width: 100%; - overflow-x: hidden; + overflow-x: auto; white-space: pre-wrap; - word-break: break-word; - overflow-wrap: anywhere; + word-break: normal; + overflow-wrap: break-word; padding: var(--space-4); border-radius: var(--radius-lg); border: 1px solid rgba(var(--primary-color-rgb), 0.15); @@ -993,6 +993,13 @@ code { margin: var(--space-4) 0; } +.doc-hosted-preview__code pre, +.doc-hosted-preview__code code { + white-space: pre-wrap !important; + word-break: normal !important; + overflow-wrap: break-word !important; +} + .doc-hosted-preview--loading, .doc-hosted-preview--error { border: 1px solid var(--border-unified); @@ -1938,8 +1945,8 @@ header a:hover, .doc-content th, .doc-content td { padding: var(--space-2) var(--space-3); - word-break: break-word; - overflow-wrap: anywhere; + word-break: normal; + overflow-wrap: break-word; vertical-align: top; } }