From ca9709f2e904f0bf3cd5c593cbf0366806f0e836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Tue, 13 Feb 2024 21:57:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Code=20copy=20doesn't=20work=20w?= =?UTF-8?q?ith=20gist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/code.js | 2 +- exampleSite/content/_index.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/js/code.js b/assets/js/code.js index 2cd3474d..88ae18d3 100644 --- a/assets/js/code.js +++ b/assets/js/code.js @@ -13,7 +13,7 @@ function createCopyButton(highlightDiv) { } async function copyCodeToClipboard(button, highlightDiv) { - const codeToCopy = highlightDiv.querySelector(":last-child > .chroma > code").innerText; + const codeToCopy = highlightDiv.querySelector(":last-child").innerText; try { result = await navigator.permissions.query({ name: "clipboard-write" }); if (result.state == "granted" || result.state == "prompt") { diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index f6858310..e70908a2 100755 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -5,11 +5,20 @@ description: "This page was built using the Blowfish theme for Hugo." Welcome to Blowfish, one of the most flexible and robust Hugo themes. It is designed to be simple, fast and content-focused. Learn more about how to install [here]({{< ref "docs/installation" >}}) or get started with our CLI using: -```node +asd + + + +```bash npx blowfish-tools ``` + + + + +