Ignore code block clicks with active selection (#448)
This commit is contained in:
parent
4ef38f3bbf
commit
c024538604
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue