We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a44550b + 885362b commit a543213Copy full SHA for a543213
src/js/07-copy-to-clipboard.js
@@ -29,10 +29,11 @@
29
// NOTE: ignore event on pseudo-element
30
if (e.currentTarget === e.target) return
31
var bashText = codeBlock.innerText
32
- // bashText.slice(2)
33
// remove '$' from copy to code functionality in code block console
34
- var spliceData = bashText.split('$').join('')
35
- if (codeBlock.dataset.lang === 'console' || bashText.includes('$')) {
+ // var spliceData = bashText.split('$').join('')
+ var check = bashText.charAt(0)
+ if (check === '$') {
36
+ var spliceData = bashText.substring(2)
37
navigator.clipboard.writeText(spliceData).then(
38
function () {
39
/* Chrome doesn't seem to blur automatically,
0 commit comments