highlight: make copy of selection work with noClasses=true #991

This commit is contained in:
Sören Weber 2025-01-25 12:46:02 +01:00
parent 8dad5ee419
commit 93b32c1672
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
3 changed files with 4 additions and 3 deletions

View file

@ -1002,7 +1002,8 @@ div.highlight > div td {
display: none; display: none;
} }
/* disable selection for lineno cells */ /* disable selection for lineno cells */
div.highlight > div td:first-child:not(:last-child) { div.highlight > div td:first-child:not(:last-child),
div.highlight > span[id] {
-webkit-user-select: none; -webkit-user-select: none;
user-select: none; user-select: none;
} }

View file

@ -1 +1 @@
7.3.1+80e448e5bdaa92c87ee0d0d86f1125c8606ebf5f 7.3.1+8dad5ee419e5bb2a0b380aa72d7a7389af4945f6

View file

@ -614,7 +614,7 @@ function initCodeClipboard() {
for (var i = 0; i < selection.rangeCount; i++) { for (var i = 0; i < selection.rangeCount; i++) {
var range = selection.getRangeAt(i); var range = selection.getRangeAt(i);
var fragment = range.cloneContents(); var fragment = range.cloneContents();
if (fragment.querySelector('.ln')) { if (fragment.querySelector('.ln') || fragment.querySelector('[id]')) {
return true; return true;
} }
} }