mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 桌面端拖入文件时可选择 使用 file:// 绝对路径并链接 或 复制为资源文件并插入 https://github.com/siyuan-note/siyuan/issues/5369
This commit is contained in:
parent
40ade96b89
commit
6d99389c01
3 changed files with 15 additions and 9 deletions
|
|
@ -16,6 +16,7 @@ import {Tab} from "../../layout/Tab";
|
|||
import {getAllModels} from "../../layout/getAll";
|
||||
import {updatePanelByEditor} from "../../editor/util";
|
||||
/// #endif
|
||||
import * as path from "path";
|
||||
import {Editor} from "../../editor";
|
||||
import {blockRender} from "../markdown/blockRender";
|
||||
import {processRender} from "./processCode";
|
||||
|
|
@ -23,7 +24,6 @@ import {highlightRender} from "../markdown/highlightRender";
|
|||
import {uploadLocalFiles} from "../upload";
|
||||
import {MenuItem} from "../../menus/Menu";
|
||||
import {insertHTML} from "./insertHTML";
|
||||
import {pathPosix} from "../../util/pathName";
|
||||
|
||||
const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Element, isBottom: boolean, direct: "col" | "row") => {
|
||||
const isSameDoc = protyle.element.contains(sourceElements[0]);
|
||||
|
|
@ -718,7 +718,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
click() {
|
||||
let fileText = "";
|
||||
files.forEach((item) => {
|
||||
fileText += `[${pathPosix().basename(item)}](file://${item})\n`;
|
||||
fileText += `[${path.basename(item)}](file://${item})\n`;
|
||||
});
|
||||
insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue