From f36cd0d62625c3221533b9e1f83a58b2cd4429a2 Mon Sep 17 00:00:00 2001 From: "Q.Ben Zheng" <40693636+Zhengqbbb@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:22:06 +0800 Subject: [PATCH] fix: remove shell code copy trailing newline (#1561) --- src/client/app/composables/copyCode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/composables/copyCode.ts b/src/client/app/composables/copyCode.ts index b861823be1a0..6c82b1b49df4 100644 --- a/src/client/app/composables/copyCode.ts +++ b/src/client/app/composables/copyCode.ts @@ -20,7 +20,7 @@ export function useCopyCode() { let { innerText: text = '' } = sibling if (isShell) { - text = text.replace(/^ *(\$|>) /gm, '') + text = text.replace(/^ *(\$|>) /gm, '').trim() } copyToClipboard(text).then(() => {