trim ending newline on copied code (#1296)

Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
This commit is contained in:
Matthew Peveler
2020-08-10 10:26:12 -04:00
committed by GitHub
parent d2e11a393f
commit 616df6223a

View File

@@ -1,6 +1,6 @@
function copyToClipboard(container) {
const el = document.createElement('textarea');
el.value = container.textContent;
el.value = container.textContent.replace(/\n$/, '');
document.body.appendChild(el);
el.select();
document.execCommand('copy');