This commit is contained in:
zsviczian
2024-07-29 18:13:13 +02:00
parent f678203a64
commit 9da40944ab
5 changed files with 15 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "2.2.12",
"version": "2.2.13",
"minAppVersion": "1.1.6",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

View File

@@ -1903,21 +1903,8 @@ export default class ExcalidrawView extends TextFileView {
}
if (state.rename === "all") {
(async () => {
let filename = await ScriptEngine.inputPrompt(
this,
this.plugin,
this.plugin.app,
"Note Title",
"Filename without extension",
this.file.basename,
);
if (!filename) {
return;
}
const {folderpath} = splitFolderAndFilename(this.file.path);
this.app.vault.rename(this.file, normalizePath(`${folderpath}/${filename}.md`));
})();
//@ts-ignore
this.app.fileManager.promptForFileRename(this.file);
return;
}

View File

@@ -184,7 +184,7 @@ export class EmbeddableSettings extends Modal {
new Notice("File rename failed. A file with this name already exists.\n"+newPath,10000);
} else {
try {
await this.app.vault.rename(this.file,newPath);
await this.app.fileManager.renameFile(this.file,newPath);
el.link = this.element.link.replace(
/(\[\[)([^#\]]*)([^\]]*]])/,`$1${
this.plugin.app.metadataCache.fileToLinktext(

View File

@@ -17,6 +17,12 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://cdn.ko-fi.com/cdn/kofi3.png?v=3" height=45></a></div>
`,
"2.2.13": `
## Fixed
- Could not undo element after pasting [#1906](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1906)
- Links broke after renaming an Excalidraw file using the F2 shortcut [#1907](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1907)
- Unable to open or convert very large ${String.fromCharCode(96)}.excalidraw${String.fromCharCode(96)} file, e.g. BoaPs you can download from [here](https://ko-fi.com/zsolt/shop)
`,
"2.2.12": `
## Fixed
- Rename moved files to root folder [#1905](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1905)

View File

@@ -2450,7 +2450,7 @@ export default class ExcalidrawPlugin extends Plugin {
log(fname);
const result = await this.app.vault.create(
fname,
FRONTMATTER + (await this.exportSceneToMD(data)),
FRONTMATTER + (await this.exportSceneToMD(data, false)),
);
if (this.settings.keepInSync) {
EXPORT_TYPES.forEach((ext: string) => {
@@ -3486,7 +3486,7 @@ export default class ExcalidrawPlugin extends Plugin {
* @param {string} data - Excalidraw scene JSON string
* @returns {string} - Text starting with the "# Text Elements" header and followed by each "## id-value" and text
*/
public async exportSceneToMD(data: string): Promise<string> {
public async exportSceneToMD(data: string, compressOverride?: boolean): Promise<string> {
if (!data) {
return "";
}
@@ -3511,7 +3511,9 @@ export default class ExcalidrawPlugin extends Plugin {
outString +
getMarkdownDrawingSection(
JSON.stringify(JSON_parse(data), null, "\t"),
this.settings.compress,
typeof compressOverride === "undefined"
? this.settings.compress
: compressOverride,
)
);
}