Merge pull request #73 from nunocoracao/72-copy-button-not-working-properly-on-code-blocks

fixed js bug on copy code module
This commit is contained in:
Nuno Coração 2022-10-04 15:42:40 +01:00 committed by GitHub
commit 81db60cf2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
var scriptBundle = document.getElementById("script-bundle");
var copyText = scriptBundle ? scriptBundle.getAttribute("data-copy") : "Copy";
var copiedText = scriptBundle ? scriptBundle.getAttribute("data-copied") : "Copied";
var copyText = scriptBundle && scriptBundle.getAttribute("data-copy")? scriptBundle.getAttribute("data-copy") : "Copy";
var copiedText = scriptBundle && scriptBundle.getAttribute("data-copied")? scriptBundle.getAttribute("data-copied") : "Copied";
function createCopyButton(highlightDiv) {
const button = document.createElement("button");