This commit is contained in:
GH Action - Upstream Sync 2024-09-24 00:42:03 +00:00
commit 4be88f7fee

View File

@ -128,8 +128,9 @@ 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(
copyToClipboard(code); ref.current.querySelector("code")?.innerText ?? "",
);
} }
}} }}
></span> ></span>