Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#5495 from ConnectAI-E/Fix-code-dupl…
Browse files Browse the repository at this point in the history
…ication

Fix code duplication
  • Loading branch information
lloydzhou authored Sep 23, 2024
2 parents 23f2b62 + d95d509 commit 4c3fd55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 4c3fd55

Please sign in to comment.