-
-
-
- {({className, style, tokens, getLineProps, getTokenProps}) => (
-
+ )}
+
);
};
diff --git a/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css b/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css
index f935f6dc760b..217d0bc106ff 100644
--- a/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css
+++ b/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css
@@ -1,3 +1,12 @@
+.codeBlock {
+ border-radius: 0;
+ font-size: inherit;
+ margin-bottom: 0;
+ overflow: hidden;
+ overflow-wrap: break-word;
+ white-space: pre-wrap;
+}
+
.codeBlockWrapper {
position: relative;
}
@@ -24,18 +33,3 @@
transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out,
bottom 200ms ease-in-out;
}
-
-.codeBlock {
- overflow: auto;
- display: block;
- padding: 0;
- font-size: inherit;
-}
-
-.codeBlockLines {
- border-radius: 0;
- margin-bottom: 0;
- float: left;
- min-width: 100%;
- padding: var(--ifm-pre-padding);
-}
-- {tokens.map((line, i) => { - const lineProps = getLineProps({line, key: i}); - - if (highlightLines.includes(i + 1)) { - lineProps.className = `${lineProps.className} docusaurus-highlight-code-line`; - } - - return ( -
+- {line.map((token, key) => ( - - ))} -- ); - })} -+ {({className, style, tokens, getLineProps, getTokenProps}) => ( + ++ ++ {tokens.map((line, i) => { + const lineProps = getLineProps({line, key: i}); + + if (highlightLines.includes(i + 1)) { + lineProps.className = `${lineProps.className} docusaurus-highlight-code-line`; + } + + return ( +- )} - -+ {line.map((token, key) => ( + + ))} ++ ); + })}