From 096e6fc0aefebcc6f19496417b0fa40a747167ab Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Tue, 26 Nov 2024 00:48:43 +0800 Subject: [PATCH] Revert "fix #13214 #13267" This reverts commit 8ca78a493842b243caf456ba49c24374bcbaafef. --- app/src/boot/globalEvent/click.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/boot/globalEvent/click.ts b/app/src/boot/globalEvent/click.ts index 0d2f26f92d3..bf741472bed 100644 --- a/app/src/boot/globalEvent/click.ts +++ b/app/src/boot/globalEvent/click.ts @@ -66,10 +66,7 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => { } const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy"); if (copyElement) { - let text = copyElement.parentElement.nextElementSibling.textContent; - if (!/(\n{2,})$/.test(text)) { - text = text.replace(/\n$/, ""); - } + let text = copyElement.parentElement.nextElementSibling.textContent.replace("/\n$/", ""); text = text.replace(/\u00A0/g, " "); // Replace non-breaking spaces with normal spaces when copying https://github.com/siyuan-note/siyuan/issues/9382 writeText(text); showMessage(window.siyuan.languages.copied, 2000);