diff options
author | Alexander Danilov <a.a.danilov@gmail.com> | 2022-07-04 09:55:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 08:55:54 +0200 |
commit | c02453860408509b714c5e853457b66ef07712fc (patch) | |
tree | 7cd4a09b0eee991de966f7c8a5c3b22337e205b9 /assets/clipboard.js | |
parent | 4ef38f3bbf5dae9a11a711d2ed1ced9294c6af5f (diff) |
Ignore code block clicks with active selection (#448)
Diffstat (limited to 'assets/clipboard.js')
-rw-r--r-- | assets/clipboard.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/assets/clipboard.js b/assets/clipboard.js index fdf84cf..2799f2f 100644 --- a/assets/clipboard.js +++ b/assets/clipboard.js @@ -11,6 +11,9 @@ document.querySelectorAll("pre code").forEach(code => { code.addEventListener("click", function (event) { + if (window.getSelection().toString()) { + return; + } select(code.parentElement); if (navigator.clipboard) { |