From: Dan Allen Date: Sat, 12 Dec 2020 03:33:33 +0000 (-0700) Subject: strip trailing space (left behind by callouts) when copying source X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f004b4d8258eadae7300aaf703ed8cd03b3a30e7;p=working%2Feg-antora.git strip trailing space (left behind by callouts) when copying source --- 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 () {