diff --git a/assets/js/code-copy-v2.js b/assets/js/code-copy-v2.js index d1fe2c7..023032a 100644 --- a/assets/js/code-copy-v2.js +++ b/assets/js/code-copy-v2.js @@ -1,6 +1,5 @@ // Tightly coupled to `render-codeblock.html` for element targeting -const copyToClipBoard = ((clipboard) => async (button) => { - const codeBlockId = button.getAttribute('data-id-codeblock'); +const copyToClipBoard = ((clipboard) => async (button, codeBlockId) => { const codeBlock = document .getElementById(codeBlockId) .getElementsByClassName('highlight')[0]; diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html index 657c92b..00350d8 100644 --- a/layouts/_default/_markup/render-codeblock.html +++ b/layouts/_default/_markup/render-codeblock.html @@ -6,7 +6,7 @@ {{- if $isSingleLine -}}