mirror of
https://github.com/KevinMidboe/schleppe-lab.git
synced 2025-10-29 17:50:39 +00:00
Align code block to new color scheme
Codeblock with line numbers change format of copy code button, updated.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// This assumes that you're using Rouge; if not, update the selector
|
||||
// const codeBlocks = document.querySelectorAll('.code-header + .highlighter-rouge');
|
||||
const codeBlocks = document.querySelectorAll('div.highlight');
|
||||
const codeBlocks = document.querySelectorAll('figure.highlight');
|
||||
const copyCodeButtons = document.querySelectorAll('.copy-code-button');
|
||||
|
||||
codeBlocks.forEach((codeBlock) => {
|
||||
@@ -13,7 +13,7 @@ codeBlocks.forEach((codeBlock) => {
|
||||
codeBlock.append(copyButton);
|
||||
|
||||
copyButton.addEventListener('click', function () {
|
||||
const code = codeBlock.querySelector('code').innerText.trim();
|
||||
const code = codeBlock.querySelector('.code').innerText.trim();
|
||||
window.navigator.clipboard.writeText(code);
|
||||
|
||||
copyButton.innerText = 'Copied';
|
||||
|
||||
Reference in New Issue
Block a user