mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
e261977812
commit
370d841b61
2 changed files with 7 additions and 2 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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">`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue