mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
Set folder to current active folder if Excalidraw Folder name starts with "./" and embedUseExcalidrawFolder is true.
This commit is contained in:
@@ -98,7 +98,7 @@ import {
|
||||
isCallerFromTemplaterPlugin,
|
||||
decompress,
|
||||
} from "./utils/Utils";
|
||||
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, getNewOrAdjacentLeaf, getParentOfClass, isObsidianThemeDark, openLeaf } from "./utils/ObsidianUtils";
|
||||
import { extractSVGPNGFileName, getActivePDFPageNumberFromPDFView, getAttachmentsFolderAndFilePath, getCurrentActiveDirectory, getNewOrAdjacentLeaf, getParentOfClass, isObsidianThemeDark, openLeaf } from "./utils/ObsidianUtils";
|
||||
import { ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawImageElement, ExcalidrawTextElement, FileId } from "@zsviczian/excalidraw/types/excalidraw/element/types";
|
||||
import { ScriptEngine } from "./Scripts";
|
||||
import {
|
||||
@@ -1093,7 +1093,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
this.settings,
|
||||
);
|
||||
const folder = this.settings.embedUseExcalidrawFolder
|
||||
? null
|
||||
? (this.settings.folder && this.settings.folder.startsWith("./")) ? getCurrentActiveDirectory(activeView.file.path, this.settings.folder) : null
|
||||
: (
|
||||
await getAttachmentsFolderAndFilePath(
|
||||
this.app,
|
||||
@@ -1101,6 +1101,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
filename,
|
||||
)
|
||||
).folder;
|
||||
|
||||
const file = await this.createDrawing(filename, folder);
|
||||
await this.embedDrawing(file);
|
||||
this.openDrawing(file, location, true, undefined, true);
|
||||
|
||||
Reference in New Issue
Block a user