Skip to content
Snippets Groups Projects
Unverified Commit c0245386 authored by Alexander Danilov's avatar Alexander Danilov Committed by GitHub
Browse files

Ignore code block clicks with active selection (#448)

parent 4ef38f3b
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
document.querySelectorAll("pre code").forEach(code => { document.querySelectorAll("pre code").forEach(code => {
code.addEventListener("click", function (event) { code.addEventListener("click", function (event) {
if (window.getSelection().toString()) {
return;
}
select(code.parentElement); select(code.parentElement);
if (navigator.clipboard) { if (navigator.clipboard) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment