diff --git a/README.md b/README.md index b9780a3..7d6e479 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Obsidian-Excalidraw plugin integrates [Excalidraw](https://excalidraw.com/), Thank you for updating to Excalidraw 1.1.x! -I have improved how drawings are embedded! You no longer need an Excalidraw codeblock. You can now embed drawings just like any other images: `![[my drawing.excalidraw]]` or `![[my drawing.excalidraw|500|left]]` or `![[my drawing.excalidraw|right-wrap]]`, `![alttext|500|right](drawing.excalidraw)`, `![](folder/drawing.excalidraw)` etc. You get the idea. +I have improved how drawings are embedded! You no longer need an Excalidraw codeblock. You can now embed drawings just like any other images: `![[my drawing.excalidraw]]` or `![[my drawing.excalidraw|500|left]]` or `![[my drawing.excalidraw|right-wrap]]`, `![alttext|500|right](drawing.excalidraw)`, `![](folder/drawing.excalidraw)`, etc. You get the idea. ### Detailed release notes are under the How to videos. diff --git a/manifest.json b/manifest.json index 51b26a0..a7c45b0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.1.6", + "version": "1.1.7", "minAppVersion": "0.11.13", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 712251f..d24ca87 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -142,6 +142,13 @@ export default class ExcalidrawView extends TextFileView { new Notice('File name cannot contain any of the following characters: * " \\  < > : | ?',4000); return; } + if (!ev.shiftKey) { + const file = this.app.metadataCache.getFirstLinkpathDest(text,this.file.path); + if (!file) { + new Notice("File does not exist. Hold down SHIFT (or CTRL+SHIFT) and click link button to create.", 4000); + return; + } + } try { this.app.workspace.openLinkText(text,this.file.path,ev.ctrlKey||ev.metaKey); } catch (e) { diff --git a/src/main.ts b/src/main.ts index badd95d..399916b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -145,6 +145,7 @@ export default class ExcalidrawPlugin extends Plugin { fwidth = drawing.getAttribute("width"); fheight = drawing.getAttribute("height"); alt = drawing.getAttribute("alt"); + if(alt == fname) alt = ""; //when the filename starts with numbers followed by a space Obsidian recognizes the filename as alt-text divclass = "excalidraw-svg"; if(alt) { //for some reason ![]() is rendered in a DIV and ![[]] in a span by Obsidian diff --git a/src/settings.ts b/src/settings.ts index cb37654..307a1ff 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -93,7 +93,7 @@ export class ExcalidrawSettingTab extends PluginSettingTab { await this.plugin.saveSettings(); })); - this.containerEl.createEl('h1', {text: 'New darwing filename'}); + this.containerEl.createEl('h1', {text: 'New drawing filename'}); containerEl.createDiv('',(el) => { el.innerHTML = '

The automatically generated filename consists of a prefix and a date. ' + 'e.g."Drawing 2021-05-24 12.58.07".

'+ diff --git a/versions.json b/versions.json index 7c4cfa8..2b235c2 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.1.6": "0.11.13" + "1.1.7": "0.11.13" }