diff --git a/assets/css/torchlight.css b/assets/css/torchlight.css index ec4febc..d5b2edd 100644 --- a/assets/css/torchlight.css +++ b/assets/css/torchlight.css @@ -103,6 +103,9 @@ When the code block is hovered, bring all the lines into focus. overflow-x: visible; } +/* +Insert prompt indicators on interactive shells. +*/ .cmd::before { color: var(--base07); content: "$ "; @@ -113,12 +116,15 @@ When the code block is hovered, bring all the lines into focus. content: "# "; } -.cmd_return { - webkit-user-select: none; - user-select: none; -} - .cmd_pwsh::before { color: var(--base07); content: "PS> "; +} + +/* +Don't copy shell outputs +*/ +.nocopy { + webkit-user-select: none; + user-select: none; } \ No newline at end of file diff --git a/assets/js/code-copy-button.js b/assets/js/code-copy-button.js index 71dc904..26f1d0b 100644 --- a/assets/js/code-copy-button.js +++ b/assets/js/code-copy-button.js @@ -16,8 +16,8 @@ function createCopyButton(highlightDiv) { document.querySelectorAll(".highlight").forEach((highlightDiv) => createCopyButton(highlightDiv)); async function copyCodeToClipboard(button, highlightDiv) { - // capture all code lines in the selected block which aren't classed `cmd_return` - let codeToCopy = highlightDiv.querySelectorAll(":last-child > .torchlight > code > .line:not(.cmd_return)"); + // capture all code lines in the selected block which aren't classed `nocopy` + let codeToCopy = highlightDiv.querySelectorAll(":last-child > .torchlight > code > .line:not(.nocopy)"); // now remove the first-child of each line which has class `line-number` codeToCopy = Array.from(codeToCopy).reduce((accumulator, line) => { if (line.firstChild.className != "line-number") {