mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-26 08:52:18 +00:00
change class name
This commit is contained in:
parent
e336ce87a2
commit
ffd7be9de5
2 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
}
|
|
@ -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") {
|
||||
|
|
Loading…
Reference in a new issue