Correct "copy" src block function

This commit is contained in:
2021-01-01 18:02:41 +01:00
parent d89f8538c3
commit b59cc4841f
6 changed files with 321 additions and 270 deletions

View File

@@ -32,8 +32,10 @@ docReady(function() {
let srcContainers = document.querySelectorAll('pre.src');
function copyClickFunction() {
let boxCopy = this;
// Create a clone the node to not affect the original one
let nodeClone = this.parentNode.cloneNode(true);
let nodeClone = boxCopy.parentNode.cloneNode(true);
// Remove Line Numbers and Copy Button
let linenumNodes = nodeClone.querySelectorAll('.linenr,.src-copy');