From f004b4d8258eadae7300aaf703ed8cd03b3a30e7 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Fri, 11 Dec 2020 20:33:33 -0700 Subject: [PATCH] strip trailing space (left behind by callouts) when copying source --- src/js/06-copy-to-clipboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/06-copy-to-clipboard.js b/src/js/06-copy-to-clipboard.js index 9562dfa..ab1de52 100644 --- a/src/js/06-copy-to-clipboard.js +++ b/src/js/06-copy-to-clipboard.js @@ -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 () { -- 2.11.0