diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0534cb12e..513a10d4e 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -123,7 +123,8 @@ blocks.forEach((block) => { // only add button if browser supports Clipboard API - if (navigator.clipboard) { + + if (navigator.clipboard && block.childNodes.length < 2) { let button = document.createElement('button'); button.innerText = 'Copy Code'; @@ -380,6 +381,7 @@ responseMessage.context = data.context; messages = messages; hljs.highlightAll(); + createCopyCodeBlockButton(); } } } @@ -477,6 +479,7 @@ responseMessage.context = data.context; messages = messages; hljs.highlightAll(); + createCopyCodeBlockButton(); } } } @@ -661,7 +664,7 @@ {:else}