fix: spreadsheets paste (#1982)

This commit is contained in:
Philip Okugbe
2026-03-02 17:37:56 +00:00
committed by GitHub
parent 616d9297eb
commit a3fd79dae8
@@ -54,7 +54,10 @@ export const handlePaste = (
return true;
}
if (event.clipboardData?.files.length) {
const htmlData = event.clipboardData?.getData("text/html");
const hasHtmlTable = htmlData && /<table[\s>]/i.test(htmlData);
if (event.clipboardData?.files.length && !hasHtmlTable) {
event.preventDefault();
for (const file of event.clipboardData.files) {
const pos = editor.state.selection.from;
@@ -65,7 +68,6 @@ export const handlePaste = (
return true;
}
const htmlData = event.clipboardData?.getData("text/html");
if (htmlData && ATTACHMENT_URL_RE.test(htmlData)) {
const pasteFrom = editor.state.selection.from;
setTimeout(() => {