Skip to content

Commit

Permalink
strip trailing space (left behind by callouts) when copying source
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Dec 12, 2020
1 parent 61185ad commit f004b4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/06-copy-to-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

function writeToClipboard (code) {
var text = code.innerText
var text = code.innerText.replace(/ *$/gm, '')
if (code.dataset.lang === 'console' && text.startsWith('$ ')) text = extractCommands(text)
window.navigator.clipboard.writeText(text).then(
function () {
Expand Down

0 comments on commit f004b4d

Please sign in to comment.