From 93b32c1672553781d911855cb9b8f106626a216e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Weber?= <mail@soeren-weber.de>
Date: Sat, 25 Jan 2025 12:46:02 +0100
Subject: [PATCH] highlight: make copy of selection work with noClasses=true
 #991

---
 assets/css/theme.css         | 3 ++-
 layouts/partials/version.txt | 2 +-
 static/js/theme.js           | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/assets/css/theme.css b/assets/css/theme.css
index 2a772a9cae..d6538448b3 100644
--- a/assets/css/theme.css
+++ b/assets/css/theme.css
@@ -1002,7 +1002,8 @@ div.highlight > div td {
   display: none;
 }
 /* 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;
   user-select: none;
 }
diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt
index 142dd82cfb..ddcbf33c02 100644
--- a/layouts/partials/version.txt
+++ b/layouts/partials/version.txt
@@ -1 +1 @@
-7.3.1+80e448e5bdaa92c87ee0d0d86f1125c8606ebf5f
\ No newline at end of file
+7.3.1+8dad5ee419e5bb2a0b380aa72d7a7389af4945f6
\ No newline at end of file
diff --git a/static/js/theme.js b/static/js/theme.js
index 05f421fc8e..4869b105b7 100644
--- a/static/js/theme.js
+++ b/static/js/theme.js
@@ -614,7 +614,7 @@ function initCodeClipboard() {
       for (var i = 0; i < selection.rangeCount; i++) {
         var range = selection.getRangeAt(i);
         var fragment = range.cloneContents();
-        if (fragment.querySelector('.ln')) {
+        if (fragment.querySelector('.ln') || fragment.querySelector('[id]')) {
           return true;
         }
       }