Merge pull request #5495 from ConnectAI-E/Fix-code-duplication

Fix code duplication
This commit is contained in:
Lloyd Zhou 2024-09-23 16:06:59 +08:00 committed by GitHub
commit 4c3fd55a75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

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