From 9db7b490379d50c3213236e91fbfffe16ac07583 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 7 Aug 2024 23:36:06 +0800 Subject: [PATCH] :art: Improve the pasting of selected text in PDF rectangular annotation https://github.com/siyuan-note/siyuan/issues/11629 --- 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 dc6732127..307fd540b 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -241,6 +241,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven files = event.dataTransfer.items; } } + + // Improve the pasting of selected text in PDF rectangular annotation https://github.com/siyuan-note/siyuan/issues/11629 + textPlain = textPlain.replace(/\r\n|\r|\u2028|\u2029/g, "\n"); + /// #if !BROWSER // 不再支持 PC 浏览器 https://github.com/siyuan-note/siyuan/issues/7206 if (!siyuanHTML && !textHTML && !textPlain && ("clipboardData" in event)) {