Skip to content

Commit 2619b2d

Browse files
authored
Merge pull request #221 from spinkube/fix-220
strip prompt characters from command
2 parents 5058894 + fcf2f26 commit 2619b2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

assets/js/click-to-copy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
let codeListings = document.querySelectorAll('.highlight > pre');
22

33
const copyCode = (codeSample) => {
4-
navigator.clipboard.writeText(codeSample.textContent.trim() + '\n');
4+
const fullText = codeSample.textContent.trim();
5+
navigator.clipboard.writeText(fullText.replaceAll('$ ', '') + '\n');
56
};
67

78
for (let index = 0; index < codeListings.length; index++) {

0 commit comments

Comments
 (0)