From 1fac9971e9bfca21e8bbde972bfaa97f1b6f7d73 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 12 Jan 2024 21:28:37 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/10159 --- app/src/protyle/gutter/index.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 65df6926e..eda8c159c 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -716,15 +716,11 @@ export class Gutter { accelerator: "⌘C", click() { if (isNotEditBlock(selectsElement[0])) { - let html = ""; - selectsElement.forEach(item => { - html += removeEmbed(item); - }); - writeText(protyle.lute.BlockDOM2StdMd(html).trimEnd()); + focusBlock(selectsElement[0]); } else { focusByRange(getEditorRange(selectsElement[0])); - document.execCommand("copy"); } + document.execCommand("copy"); } }, { label: window.siyuan.languages.copyPlainText, @@ -1157,11 +1153,11 @@ export class Gutter { accelerator: "⌘C", click() { if (isNotEditBlock(nodeElement)) { - writeText(protyle.lute.BlockDOM2StdMd(removeEmbed(nodeElement)).trimEnd()); + focusBlock(nodeElement); } else { focusByRange(getEditorRange(nodeElement)); - document.execCommand("copy"); } + document.execCommand("copy"); } }, { label: window.siyuan.languages.copyPlainText,