From f534be17945e2fb5aea173f82f0f621b6ff03bc5 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 18 Aug 2022 19:39:53 +0800 Subject: [PATCH] :bug: windows https://github.com/siyuan-note/siyuan/issues/5667 --- app/src/protyle/util/paste.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 2d6d26ba7..b8faafaea 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -107,6 +107,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven if (doc.body && doc.body.innerHTML) { textHTML = doc.body.innerHTML; } + // windows 剪切板 + if (textHTML.startsWith("\n") && textHTML.endsWith("\n\n")) { + textHTML = doc.body.innerHTML.trim().replace("", "").replace("", ""); + } } textHTML = Lute.Sanitize(textHTML);