From 35aa2c7270042acfbbd4049fc0e48fefd1aafb10 Mon Sep 17 00:00:00 2001 From: lyf <1910527151@qq.com> Date: Mon, 23 Sep 2024 11:34:20 +0800 Subject: [PATCH 1/2] Fix code duplication --- app/components/markdown.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index b57fd74904c..17823300013 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -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 ?? "", + ); } }} > From d95d509046392996941b2e757f795e53ae7f4b38 Mon Sep 17 00:00:00 2001 From: lyf <1910527151@qq.com> Date: Mon, 23 Sep 2024 15:43:36 +0800 Subject: [PATCH 2/2] fex --- app/components/markdown.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 17823300013..4f1b0ed24ea 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -128,7 +128,6 @@ export function PreCode(props: { children: any }) { className="copy-code-button" onClick={() => { if (ref.current) { - // const code = ref.current.innerText; copyToClipboard( ref.current.querySelector("code")?.innerText ?? "", );