diff --git a/static/js/global-script.js b/static/js/global-script.js index 96e61e6d6f..5e2705eb44 100644 --- a/static/js/global-script.js +++ b/static/js/global-script.js @@ -9,7 +9,7 @@ function setupCodeBlockCopyButton() { const elem = $(this).closest('.code-container').find('code').clone(); elem.find('.command-prefix').remove(); // removing prefix elem.find('.disable-copy').remove(); // removing text which shouldn't be copied - navigator.clipboard.writeText(elem.text()); + navigator.clipboard.writeText(elem.text().trim()); $(this).find('span').text('Copied!'); setTimeout(() => { $(this).find('span').text('Copy');