Prevent copying code line numbers on Safari

This commit is contained in:
Cotes Chung 2021-09-16 18:42:50 +08:00
parent 1b16b152df
commit 4001ef7cba
3 changed files with 4 additions and 3 deletions

View file

@ -35,7 +35,8 @@ $(function() {
// Initial the clipboard.js object // Initial the clipboard.js object
const clipboard = new ClipboardJS(btnSelector, { const clipboard = new ClipboardJS(btnSelector, {
target(trigger) { target(trigger) {
return trigger.parentNode.nextElementSibling; let codeBlock = trigger.parentNode.nextElementSibling;
return codeBlock.querySelector('code .rouge-code');
} }
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long