Skip to content

Commit

Permalink
fix: code removes all "copy code" btns not only first one
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmarinwork committed Dec 6, 2022
1 parent d548db8 commit 9e3db0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ function downloadThread({ as = Format.PNG } = {}) {
}

//Delete copy button from code blocks
cloneDoc.querySelector('button.flex').remove();
let listOfCopyBtns = cloneDoc.querySelectorAll('button.flex');

for (let i = 0, leng = listOfCopyBtns.length; i < leng; i++) {
let button = listOfCopyBtns[i];
button.remove();
}
}
}
).then(async function (canvas) {
Expand Down

0 comments on commit 9e3db0c

Please sign in to comment.