Fix code duplication
This commit is contained in:
parent
23f2b6213c
commit
35aa2c7270
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue