mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
648d00e587
commit
c8177c262e
4 changed files with 12 additions and 8 deletions
|
|
@ -32,8 +32,8 @@ const filterClipboardHint = (protyle: IProtyle, textPlain: string) => {
|
|||
};
|
||||
|
||||
export const pasteAsPlainText = async (protyle: IProtyle) => {
|
||||
/// #if !BROWSER
|
||||
let localFiles: string[] = [];
|
||||
/// #if !BROWSER
|
||||
if ("darwin" === window.siyuan.config.system.os) {
|
||||
const xmlString = clipboard.read("NSFilenamesPboardType");
|
||||
const domParser = new DOMParser();
|
||||
|
|
@ -50,10 +50,15 @@ export const pasteAsPlainText = async (protyle: IProtyle) => {
|
|||
if (localFiles.length > 0) {
|
||||
uploadLocalFiles(localFiles, protyle, false);
|
||||
writeText("");
|
||||
} else {
|
||||
getCurrentWindow().webContents.pasteAndMatchStyle();
|
||||
}
|
||||
/// #endif
|
||||
if (localFiles.length === 0) {
|
||||
getCurrentWindow().webContents.pasteAndMatchStyle();
|
||||
// 下个版本再进行修改 https://github.com/siyuan-note/siyuan/issues/8010
|
||||
// navigator.clipboard.readText().then(async textPlain => {
|
||||
// insertHTML(protyle.lute.BlockDOM2Content(protyle.lute.Md2BlockDOM(textPlain)), protyle);
|
||||
// });
|
||||
}
|
||||
};
|
||||
|
||||
export const pasteText = (protyle: IProtyle, textPlain: string, nodeElement: Element) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue