fix: code copy failed (#2168)

This commit is contained in:
Liu Yuhe
2024-09-02 20:04:11 +08:00
committed by GitHub
parent 167fbbd256
commit 1c101873d7
+1 -1
View File
@@ -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)")