|
@@ -128,8 +128,10 @@ export function PreCode(props: { children: any }) {
|
|
|
className="copy-code-button"
|
|
className="copy-code-button"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
if (ref.current) {
|
|
if (ref.current) {
|
|
|
- const code = ref.current.innerText;
|
|
|
|
|
- copyToClipboard(code);
|
|
|
|
|
|
|
+ // const code = ref.current.innerText;
|
|
|
|
|
+ copyToClipboard(
|
|
|
|
|
+ ref.current.querySelector("code")?.innerText ?? "",
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
></span>
|
|
></span>
|