From bdb14723b32db6fd5c621d66e27b96e3fc991f54 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 16 Dec 2022 18:18:27 +0100 Subject: [PATCH] fix: chart pasting not working due to removing tab characters (#5987) --- src/clipboard.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clipboard.ts b/src/clipboard.ts index e5d0712d..bf90a4b1 100644 --- a/src/clipboard.ts +++ b/src/clipboard.ts @@ -8,7 +8,6 @@ import { tryParseSpreadsheet, Spreadsheet, VALID_SPREADSHEET } from "./charts"; import { EXPORT_DATA_TYPES, MIME_TYPES } from "./constants"; import { isInitializedImageElement } from "./element/typeChecks"; import { isPromiseLike } from "./utils"; -import { normalizeText } from "./element/textElement"; type ElementsClipboard = { type: typeof EXPORT_DATA_TYPES.excalidrawClipboard; @@ -119,7 +118,7 @@ export const getSystemClipboard = async ( : probablySupportsClipboardReadText && (await navigator.clipboard.readText()); - return normalizeText(text || "").trim(); + return (text || "").trim(); } catch { return ""; } @@ -148,6 +147,7 @@ export const parseClipboard = async ( // technically possible it's staler than in-app clipboard const spreadsheetResult = !isPlainPaste && parsePotentialSpreadsheet(systemClipboard); + if (spreadsheetResult) { return spreadsheetResult; }