mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00: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 () => {
|
export const readClipboard = async () => {
|
||||||
const text: IClipboardData = {textPlain: "", textHTML: "", siyuanHTML: ""};
|
const text: IClipboardData = {textPlain: "", textHTML: "", siyuanHTML: ""};
|
||||||
try {
|
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) {
|
for (const item of clipboardContents) {
|
||||||
if (item.types.includes("text/html")) {
|
if (item.types.includes("text/html")) {
|
||||||
const blob = await item.getType("text/html");
|
const blob = await item.getType("text/html");
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ export class WYSIWYG {
|
||||||
if (isRefText) {
|
if (isRefText) {
|
||||||
html += getTextStar(item) + "\n\n";
|
html += getTextStar(item) + "\n\n";
|
||||||
} else {
|
} else {
|
||||||
let itemHTML = ""
|
let itemHTML = "";
|
||||||
if (item.getAttribute("data-type") === "NodeListItem") {
|
if (item.getAttribute("data-type") === "NodeListItem") {
|
||||||
listHTML = `<div data-subtype="${item.getAttribute("data-subtype")}" data-node-id="${Lute.NewNodeID()}" data-type="NodeList" class="list">`;
|
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