diff --git a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/String.tsx b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/String.tsx
index b7ee289e2dca..28bdaea826e7 100644
--- a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/String.tsx
+++ b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/String.tsx
@@ -62,6 +62,21 @@ export default function CodeBlockString({
const showLineNumbers =
showLineNumbersProp ?? containsLineNumbers(metastring);
+ function ButtonGroup() {
+ return (
+
+ {(wordWrap.isEnabled || wordWrap.isCodeScrollable) && (
+ wordWrap.toggle()}
+ isEnabled={wordWrap.isEnabled}
+ />
+ )}
+
+
+ );
+ }
+
return (
- {title && {title}
}
+ {title && (
+
+ {title}
+
+
+ )}
)}
-
- {(wordWrap.isEnabled || wordWrap.isCodeScrollable) && (
- wordWrap.toggle()}
- isEnabled={wordWrap.isEnabled}
- />
- )}
-
-
+ {!title &&
}
);
diff --git a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/styles.module.css b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/styles.module.css
index 3760c530c4c4..508aa048a38e 100644
--- a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/styles.module.css
+++ b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Content/styles.module.css
@@ -19,6 +19,9 @@
padding: 0.75rem var(--ifm-pre-padding);
border-top-left-radius: inherit;
border-top-right-radius: inherit;
+ position: relative;
+ /* rtl:ignore */
+ direction: ltr;
}
.codeBlock {