Vanessa 2025-10-13 11:32:18 +08:00
parent e261977812
commit 370d841b61
2 changed files with 7 additions and 2 deletions

View file

@ -127,7 +127,12 @@ export const getLocalFiles = async () => {
export const readClipboard = async () => {
const text: IClipboardData = {textPlain: "", textHTML: "", siyuanHTML: ""};
try {
const clipboardContents = await navigator.clipboard.read();
const clipboardContents = await navigator.clipboard.read().catch(() => {
alert(window.siyuan.languages.clipboardPermissionDenied);
});
if (!clipboardContents) {
return text;
}
for (const item of clipboardContents) {
if (item.types.includes("text/html")) {
const blob = await item.getType("text/html");

View file

@ -306,7 +306,7 @@ export class WYSIWYG {
if (isRefText) {
html += getTextStar(item) + "\n\n";
} else {
let itemHTML = ""
let itemHTML = "";
if (item.getAttribute("data-type") === "NodeListItem") {
listHTML = `<div data-subtype="${item.getAttribute("data-subtype")}" data-node-id="${Lute.NewNodeID()}" data-type="NodeList" class="list">`;
}