From fc66942b6c8baf8254df2064a2301f2ae9329d53 Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Wed, 2 Apr 2025 19:27:29 +0200 Subject: [PATCH] fix: paste the text copied from the app without additional characters --- src/hooks/useHtmlPaste/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/useHtmlPaste/index.ts b/src/hooks/useHtmlPaste/index.ts index d37f7c831559..c181fe32b69e 100644 --- a/src/hooks/useHtmlPaste/index.ts +++ b/src/hooks/useHtmlPaste/index.ts @@ -149,6 +149,12 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, isActive return; } } + // If HTML starts with

, it means that the text was copied from the markdown input from the native app + // and was saved to clipboard with additional styling, so we need to treat this as plain text to avoid adding unnecessary characters. + if (pastedHTML.startsWith('

')) { + handlePastePlainText(event); + return; + } handlePastedHTML(pastedHTML); return; }