From f69b86348b07be48980700c37eaaaffc482870b7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 20 Nov 2025 22:07:00 +0100 Subject: [PATCH] contrib/html: add a class for code... ... and make sure the notification generator does not suffer strange styles. --- contrib/html.sh | 2 +- general/style.css | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/html.sh b/contrib/html.sh index 098ba46..03eba23 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -14,7 +14,7 @@ markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' \ -e '//s|pre|pre onclick="CopyToClipboard(this)"|g' \ + -e '/^
/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \
 	-e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|'
 
 sed \
diff --git a/general/style.css b/general/style.css
index 191c0f6..6f75803 100644
--- a/general/style.css
+++ b/general/style.css
@@ -58,6 +58,8 @@ p.hint {
 pre {
   font-family: fira-mono, monospace;
   white-space: pre-wrap;
+}
+pre.code {
   background-color: #f8f8f8;
   border: 1px solid #ccc;
   overflow: auto;
@@ -69,7 +71,7 @@ pre code {
   padding: 0;
   border: 0;
 }
-pre::before {
+pre.code::before {
   content: "📋 Copy!";
   float: right;
   border: 1px solid #ccc;