diff --git a/.gitignore b/.gitignore index c2ec6c1..9efad08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store public/ bin/ +.idea/ \ No newline at end of file diff --git a/internal/assets/doco.js b/internal/assets/doco.js index 9bc8963..ca829ea 100644 --- a/internal/assets/doco.js +++ b/internal/assets/doco.js @@ -13,9 +13,10 @@ let doco = { document.querySelectorAll("pre").forEach((el) => { let bt = document.createElement("button"); bt.classList.add("material-symbols-outlined", "absolute", "top-3", "right-2", "p-1.5", "bg-gray-50", "hover:bg-gray-100", "rounded"); + const elementTextContent = el.textContent bt.appendChild(document.createTextNode("content_copy")); bt.addEventListener("click", () => { - navigator.clipboard.writeText(el.textContent); + navigator.clipboard.writeText(elementTextContent); // Add a notice that the code was copied let notice = document.createElement("div");