mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 14:43:06 +08:00
fix: spreadsheets paste (#1982)
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user