diff --git a/assets/js/code-copy-button.js b/assets/js/code-copy-button.js index aff9abc..cff2619 100644 --- a/assets/js/code-copy-button.js +++ b/assets/js/code-copy-button.js @@ -16,8 +16,8 @@ function createCopyButton(highlightDiv) { document.querySelectorAll(".highlight").forEach((highlightDiv) => createCopyButton(highlightDiv)); async function copyCodeToClipboard(button, highlightDiv) { - // capture all code lines in the selected block which aren't classed `nocopy` - let codeToCopy = highlightDiv.querySelectorAll(":last-child > .torchlight > code > .line:not(.nocopy)"); + // capture all code lines in the selected block which aren't classed `nocopy` or `line-remove` + let codeToCopy = highlightDiv.querySelectorAll(":last-child > .torchlight > code > .line:not(.nocopy, .line-remove)"); // now remove the first-child of each line which has class `line-number` codeToCopy = Array.from(codeToCopy).reduce((accumulator, line) => { if (line.firstChild.className != "line-number") {