mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "1.3.19",
|
||||
"version": "1.3.20",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
@@ -331,7 +331,7 @@ export async function initExcalidrawAutomate(plugin: ExcalidrawPlugin) {
|
||||
gridSize: template?.appState?.gridSize ?? this.canvas.gridSize,
|
||||
files: template?.appState?.files ?? {},
|
||||
}
|
||||
}))
|
||||
},null,"\t"))
|
||||
);
|
||||
},
|
||||
async createSVG(templatePath?:string,embedFont:boolean = false):Promise<SVGSVGElement> {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -98,8 +98,8 @@ export default class ExcalidrawView extends TextFileView {
|
||||
}
|
||||
const filepath = this.file.path.substring(0,this.file.path.lastIndexOf('.md')) + '.excalidraw';
|
||||
const file = this.app.vault.getAbstractFileByPath(normalizePath(filepath));
|
||||
if(file && file instanceof TFile) this.app.vault.modify(file,JSON.stringify(scene));
|
||||
else this.app.vault.create(filepath,JSON.stringify(scene));
|
||||
if(file && file instanceof TFile) this.app.vault.modify(file,JSON.stringify(scene,null,"\t"));
|
||||
else this.app.vault.create(filepath,JSON.stringify(scene,null,"\t"));
|
||||
}
|
||||
|
||||
public saveSVG(scene?: any) {
|
||||
@@ -199,7 +199,7 @@ export default class ExcalidrawView extends TextFileView {
|
||||
if(this.plugin.settings.autoexportSVG) this.saveSVG(scene);
|
||||
if(this.plugin.settings.autoexportPNG) this.savePNG(scene);
|
||||
}
|
||||
return JSON.stringify(scene);
|
||||
return JSON.stringify(scene,null,"\t");
|
||||
}
|
||||
return this.data;
|
||||
}
|
||||
@@ -496,12 +496,12 @@ export default class ExcalidrawView extends TextFileView {
|
||||
const folderpath = splitFolderAndFilename(this.file.path).folderpath;
|
||||
await checkAndCreateFolder(this.app.vault,folderpath); //create folder if it does not exist
|
||||
const fname = getNewUniqueFilepath(this.app.vault,filename,folderpath);
|
||||
this.app.vault.create(fname,JSON.stringify(this.getScene()));
|
||||
this.app.vault.create(fname,JSON.stringify(this.getScene(),null,"\t"));
|
||||
new Notice("Exported to " + fname,6000);
|
||||
});
|
||||
return;
|
||||
}
|
||||
download('data:text/plain;charset=utf-8',encodeURIComponent(JSON.stringify(this.getScene())), this.file.basename+'.excalidraw');
|
||||
download('data:text/plain;charset=utf-8',encodeURIComponent(JSON.stringify(this.getScene(),null,"\t")), this.file.basename+'.excalidraw');
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -113,6 +113,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
//inspiration taken from kanban:
|
||||
//https://github.com/mgmeyers/obsidian-kanban/blob/44118e25661bff9ebfe54f71ae33805dc88ffa53/src/main.ts#L267
|
||||
this.registerMonkeyPatches();
|
||||
new Notice("Excalidraw was updated. Files opened with this version will not open with the older version. Please update plugin on all your devices.\n\nI will remove this message with next update.",8000);
|
||||
if(this.settings.loadCount<1) this.migrationNotice();
|
||||
const electron:string = process.versions.electron;
|
||||
if(electron.startsWith("8.")) {
|
||||
@@ -1137,7 +1138,7 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
}
|
||||
outString += te.text+' ^'+id+'\n\n';
|
||||
}
|
||||
return outString + this.getMarkdownDrawingSection(JSON.stringify(JSON_parse(data)));
|
||||
return outString + this.getMarkdownDrawingSection(JSON.stringify(JSON_parse(data),null,"\t"));
|
||||
}
|
||||
|
||||
public async createDrawing(filename: string, onNewPane: boolean, foldername?: string, initData?:string):Promise<string> {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"1.3.19": "0.11.13"
|
||||
"1.3.20": "0.11.13"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user