fix: chart pasting not working due to removing tab characters (#5987)
This commit is contained in:
parent
cc9e764585
commit
bdb14723b3
@ -8,7 +8,6 @@ import { tryParseSpreadsheet, Spreadsheet, VALID_SPREADSHEET } from "./charts";
|
|||||||
import { EXPORT_DATA_TYPES, MIME_TYPES } from "./constants";
|
import { EXPORT_DATA_TYPES, MIME_TYPES } from "./constants";
|
||||||
import { isInitializedImageElement } from "./element/typeChecks";
|
import { isInitializedImageElement } from "./element/typeChecks";
|
||||||
import { isPromiseLike } from "./utils";
|
import { isPromiseLike } from "./utils";
|
||||||
import { normalizeText } from "./element/textElement";
|
|
||||||
|
|
||||||
type ElementsClipboard = {
|
type ElementsClipboard = {
|
||||||
type: typeof EXPORT_DATA_TYPES.excalidrawClipboard;
|
type: typeof EXPORT_DATA_TYPES.excalidrawClipboard;
|
||||||
@ -119,7 +118,7 @@ export const getSystemClipboard = async (
|
|||||||
: probablySupportsClipboardReadText &&
|
: probablySupportsClipboardReadText &&
|
||||||
(await navigator.clipboard.readText());
|
(await navigator.clipboard.readText());
|
||||||
|
|
||||||
return normalizeText(text || "").trim();
|
return (text || "").trim();
|
||||||
} catch {
|
} catch {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -148,6 +147,7 @@ export const parseClipboard = async (
|
|||||||
// technically possible it's staler than in-app clipboard
|
// technically possible it's staler than in-app clipboard
|
||||||
const spreadsheetResult =
|
const spreadsheetResult =
|
||||||
!isPlainPaste && parsePotentialSpreadsheet(systemClipboard);
|
!isPlainPaste && parsePotentialSpreadsheet(systemClipboard);
|
||||||
|
|
||||||
if (spreadsheetResult) {
|
if (spreadsheetResult) {
|
||||||
return spreadsheetResult;
|
return spreadsheetResult;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user