瀏覽代碼

fix #13214 #13267 (#13271)

* fix #13214 #13267

* fix #13214 #13267

* Revert "fix #13214 #13267"

This reverts commit 8ca78a493842b243caf456ba49c24374bcbaafef.
Jeffrey Chen 7 月之前
父節點
當前提交
595842f915
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/src/boot/globalEvent/click.ts

+ 1 - 1
app/src/boot/globalEvent/click.ts

@@ -66,7 +66,7 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
     }
     }
     const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
     const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
     if (copyElement) {
     if (copyElement) {
-        let text = copyElement.parentElement.nextElementSibling.textContent.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
         text = text.replace(/\u00A0/g, " "); // Replace non-breaking spaces with normal spaces when copying https://github.com/siyuan-note/siyuan/issues/9382
         writeText(text);
         writeText(text);
         showMessage(window.siyuan.languages.copied, 2000);
         showMessage(window.siyuan.languages.copied, 2000);