Ignore code block clicks with active selection (#448)

pull/467/head
Alexander Danilov 2022-07-04 09:55:54 +03:00 committed by GitHub
parent 4ef38f3bbf
commit c024538604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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) {