Skip to content

Commit fd8373f

Browse files
committed
strip trailing space (left behind by callouts) when copying source
1 parent d335894 commit fd8373f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/06-copy-to-clipboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
}
5353

5454
function writeToClipboard (code) {
55-
var text = code.innerText
55+
var text = code.innerText.replace(/ *$/gm, '')
5656
if (code.dataset.lang === 'console' && text.startsWith('$ ')) text = extractCommands(text)
5757
window.navigator.clipboard.writeText(text).then(
5858
function () {

0 commit comments

Comments
 (0)