Merge pull request #5495 from ConnectAI-E/Fix-code-duplication
Fix code duplication
This commit is contained in:
commit
4c3fd55a75
|
@ -128,8 +128,9 @@ export function PreCode(props: { children: any }) {
|
||||||
className="copy-code-button"
|
className="copy-code-button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
const code = ref.current.innerText;
|
copyToClipboard(
|
||||||
copyToClipboard(code);
|
ref.current.querySelector("code")?.innerText ?? "",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
></span>
|
></span>
|
||||||
|
|
Loading…
Reference in New Issue