From cd2509e296cc00039ab22a51a2d9024b4f681a0c Mon Sep 17 00:00:00 2001 From: Conrad Zelck <git@simpel.cc> Date: Mon, 9 Oct 2023 00:10:28 +0200 Subject: [PATCH] fix: copy innerText instead of textContent Plain text before was copied without all new lines. Signed-off-by: Conrad Zelck <git@simpel.cc> --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index 166c4a9..81bef83 100644 --- a/script.js +++ b/script.js @@ -229,7 +229,7 @@ async function copyOutput() { var element = document.getElementById('output'); const html = serializeElement(element); const htmlBlob = new Blob([html], { type: 'text/html' }); - const text = element.textContent ?? ''; + const text = element.innerText ?? ''; const textBlob = new Blob([text], { type: 'text/plain' }); const clipboardItem = new ClipboardItem({ [htmlBlob.type]: htmlBlob, -- GitLab