This commit is contained in:
Vanessa 2023-01-09 21:03:41 +08:00
parent 380384ac0e
commit 49385e48de

View file

@ -193,11 +193,13 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
isHTML = true; isHTML = true;
} else if (textHTML.replace("<!--StartFragment--><!--EndFragment-->", "").trim() !== "") { } else if (textHTML.replace("<!--StartFragment--><!--EndFragment-->", "").trim() !== "") {
textHTML = textHTML.replace("<!--StartFragment-->", "").replace("<!--EndFragment-->", "").trim(); textHTML = textHTML.replace("<!--StartFragment-->", "").replace("<!--EndFragment-->", "").trim();
// 浏览器上复制单个图片应拷贝到本地excel 中的复制需粘贴 if (files && files.length === 1 && (
console.log(textHTML); textHTML.startsWith("<img") || // 浏览器上复制单个图片
if (files && files.length === 1 && textHTML.indexOf("<img") > -1) { (textHTML.startsWith("<table") && textHTML.split("<table").length === 2 && textHTML.indexOf("<img") > -1) // excel 中的复制带有图片的表格
)) {
isHTML = false; isHTML = false;
} else { } else {
// 需注意 Edge 中的画选不应识别为图片 https://github.com/siyuan-note/siyuan/issues/7021
isHTML = true; isHTML = true;
} }
} }