From 6d60bcf6eb0910c8827794f0bd9ebc271d4ea46f Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Tue, 17 Dec 2024 22:06:54 -0600 Subject: [PATCH] Allow poorly formated .excalidraw files to render There are several excalidraw implementations which fail to follow the defined excalidraw JSON schema. This allows those poorly formatted files to render in legacy mode in Obsidian. --- src/ExcalidrawData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExcalidrawData.ts b/src/ExcalidrawData.ts index 6bbad62..eaae297 100644 --- a/src/ExcalidrawData.ts +++ b/src/ExcalidrawData.ts @@ -518,7 +518,7 @@ export class ExcalidrawData { return; } - const saveVersion = this.scene.source.split("https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/")[1]??"1.8.16"; + const saveVersion = this.scene.source?.split("https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/")[1]??"1.8.16"; const elements = this.scene.elements; for (const el of elements) {