Skip to content

Commit

Permalink
fix: code copy failed (#2168)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyuhe666 authored Sep 2, 2024
1 parent 167fbbd commit 1c10187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useCodeCopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useCodeCopy = () => {
e.target.closest("button.copy-button")
if (button) {
if (button.classList.contains("copied")) return
const pre = button.nextElementSibling
const pre = button.nextElementSibling?.children[0]
if (pre?.tagName === "PRE") {
clipboardCopy(pre.textContent || "")
const textEl = button.querySelector("span:nth-child(2)")
Expand Down

0 comments on commit 1c10187

Please sign in to comment.