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