Skip to content

Commit

Permalink
Fix code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfwl committed Sep 23, 2024
1 parent 23f2b62 commit 35aa2c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 35aa2c7

Please sign in to comment.